login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A353322 A variant of Van Eck's sequence where we only consider powers of 2: for n >= 0, if a(n) = a(n-2^e) for some e, take the least such e and set a(n+1) = 2^e; otherwise a(n+1) = 0. Start with a(1) = 0. 1
0, 0, 1, 0, 2, 0, 2, 2, 1, 0, 4, 0, 2, 8, 0, 0, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2, 2, 1, 8, 4, 8, 2, 8, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
The sequence is eventually 8-periodic.
The variant with powers of 4 is 3-periodic: (0 0 1)*.
LINKS
FORMULA
a(n) = a(n-8) for n >= 25.
EXAMPLE
a(1) = 0 by definition.
a(2) = 0 as there is only one occurrence of a(1) = 0 so far.
a(3) = 2^0 = 1 as a(2) = a(2-2^0).
a(4) = 0 as there is only one occurrence of a(3) = 1 so far.
a(5) = 2^1 = 2 as a(4) = a(4-2^1).
a(6) = 0 as there is only one occurrence of a(5) = 2 so far.
a(7) = 2^1 = 2 as a(6) = a(6-2^1).
a(8) = 2^1 = 2 as a(7) = a(7-2^1).
a(9) = 2^0 = 1 as a(8) = a(8-2^0).
a(10) = 0 as a(9) <> a(9-2^e) for any admissible e.
PROG
(PARI) { for (n=1, #a=vector(87), for (e=0, oo, m = n-1-d=2^e; if (m<1, break, a[n-1]==a[m], a[n]=d; break)); print1 (a[n]", ")) }
CROSSREFS
Cf. A181391, A353323 (variant for powers of 3).
Sequence in context: A159937 A058728 A143751 * A158950 A213013 A242667
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 12 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 5 20:11 EDT 2024. Contains 372287 sequences. (Running on oeis4.)