|
|
A122002
|
|
a(0)=5; otherwise a(n) = (n mod 4) if n is odd, a(n) = h + 4, where h = (highest odd divisor of n) mod 4 if n is even.
|
|
2
|
|
|
5, 1, 5, 3, 5, 1, 7, 3, 5, 1, 5, 3, 7, 1, 7, 3, 5, 1, 5, 3, 5, 1, 7, 3, 7, 1, 5, 3, 7, 1, 7, 3, 5, 1, 5, 3, 5, 1, 7, 3, 5, 1, 5, 3, 7, 1, 7, 3, 7, 1, 5, 3, 5, 1, 7, 3, 7, 1, 5, 3, 7, 1, 7, 3, 5, 1, 5, 3, 5, 1, 7, 3, 5, 1, 5, 3, 7, 1, 7, 3, 5, 1, 5, 3, 5, 1, 7, 3, 7, 1, 5, 3, 7, 1, 7, 3, 7, 1, 5, 3, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
a(n) in {1,3,5,7} for all n. a(4k+i) = i if i is odd.
There is a typo in Grytczuk's definition: he has "+ 5" instead of "+ 4".
|
|
LINKS
|
Jui-Yi Kao, Narad Rampersad, Jeffrey Shallit, Manuel Silva, Words Avoiding Repetitions in Arithmetic Progressions, Theoretical Computer Science, volume 391, issues 1-2, February 2008, pages 126-137. And arXiv:math/0608607 [math.CO], 2006. (Extending to generalized paperfolding sequences.)
|
|
FORMULA
|
Morphism 1 -> 5,3; 3 -> 7,3; 5 -> 5,1; 7 -> 7,1 starting from 5 [Carpi, h in remark after lemma 3.2]. - Kevin Ryde, Sep 09 2020
|
|
PROG
|
(PARI) a(n) = 2*if(n, bittest(n, valuation(n, 2)+1)) + if(n%2, 1, 5); \\ Kevin Ryde, Sep 09 2020
|
|
CROSSREFS
|
Essentially the same: A112658 (map 1357 -> 0213), A125047 (map 1357 -> 2314).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|