OFFSET
1,2
COMMENTS
There is no prime among the first 5000 terms (emails from Kurt Foster, Oct 21 2015 and Oct 24 2015). When is the first prime? - N. J. A. Sloane, Oct 25 2015
There is no prime among the first 45000 terms. - Giovanni Resta, Jun 07 2018
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
FORMULA
a(n) = a(n-1) * 4^(1 + floor(log4(n))) + n. [Moved from A117640 by Jason Kimberley, Nov 27 2012]
EXAMPLE
a(7): (1)(2)(3)(10)(11)(12)(13) = 12310111213_4 = 1787239.
MATHEMATICA
a[n_]:= FromDigits[Flatten@IntegerDigits[Range@n, 4], 4]; Array[a, 20] (* Vincenzo Librandi, Dec 30 2012 *)
PROG
(Magma) [n eq 1 select 1 else Self(n-1) * 4^(1+Ilog(4, n)) + n: n in [1..20]]; // Jason Kimberley, Nov 27 2012
(Python)
from functools import reduce
def A048436(n): return reduce(lambda i, j:(i<<(bool((m:=j.bit_length())&1)<<1)+(m&-2))+j, range(n+1)) # Chai Wah Wu, Feb 26 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, May 15 1999
STATUS
approved