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.
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
Offset: 0
Keywords
Links
- A. Carpi, Multidimensional unrepetitive configurations, Theoret. Comput. Sci., 56 (1988), 233-241. a(n) = a_n of lemma 3.2 for the case p=2 and m=0 (which is corollary 3.3).
- Jaroslaw Grytczuk, Thue type problems for graphs, points and numbers, Discrete Math., 308 (2008), 4419-4429. [See Problem 15.]
- 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.)
- Index entries for sequences that are fixed points of mappings
- Index entries for sequences related to squarefree words
Crossrefs
Programs
-
Mathematica
a[0]=5;a[n_]:=If[OddQ[n],Mod[n,4],4+Mod[Select[Divisors[n],OddQ][[-1]],4]];Table[a[n],{n,0,100}] (* James C. McMahon, Oct 25 2024 *)
-
PARI
a(n) = 2*if(n,bittest(n,valuation(n,2)+1)) + if(n%2,1,5); \\ Kevin Ryde, Sep 09 2020
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
Extensions
Terms from a(26) on from John W. Layman, Aug 27 2008
Comments