Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #39 Dec 14 2023 05:22:01
%S 2,4,5,3,4,6,7,5,6,8,9,7,8,0,1,9,0,2,3,1,2,4,5,3,4,6,7,5,6,8,9,7,8,0,
%T 1,9,0,2,3,1,2,4,5,3,4,6,7,5,6,8,9,7,8,0,1,9,0,2,3,1,2,4,5,3,4,6,7,5,
%U 6,8,9,7,8,0,1,9,0,2,3,1,2,4,5,3,4,6,7,5,6,8,9,7,8,0,1,9,0,2,3,1,2,4,5,3,4
%N Start with (a, b) = (2, 4). The next pair (a', b') is ((b + 1) mod 10, (a + 1) mod 10) where (a, b) is the previous pair.
%C Has period 20.
%D Norman Sullivan, Test Your Own IQ, Workman Publishing Co. New York, NY, 1994, pp. 49, 51.
%H Harry J. Smith, <a href="/A061728/b061728.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_19">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1).
%F From _Colin Barker_, Jul 02 2018: (Start)
%F G.f.: x*(2 + 2*x + 3*x^2 + 4*x^4 + 2*x^5 + 5*x^6 + 6*x^8 + 2*x^9 + 7*x^10 + 8*x^12 - 8*x^13 + 9*x^14 + 2*x^17 + x^18) / ((1 - x)*(1 + x^2)*(1 - x + x^2 - x^3 + x^4)*(1 + x + x^2 + x^3 + x^4)*(1 - x^2 + x^4 - x^6 + x^8)).
%F a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) - a(n-6) + a(n-7) - a(n-8) + a(n-9) - a(n-10) + a(n-11) - a(n-12) + a(n-13) - a(n-14) + a(n-15) - a(n-16) + a(n-17) - a(n-18) + a(n-19) for n>19.
%F (End)
%F a(1) = 2, a(2) = 4. {a(n+1), a(n+2)} = (1 + {a(n), a(n - 1)}) mod 10. - _Michael De Vlieger_, Jul 01 2018
%F a(n) = (2*floor(n/4) + floor(3*(n mod 4)/2) + 1) mod 10. - _Jon E. Schoenfield_, Jul 01 2018
%e 24 (42)-> 53, (35)-> 46, (64)-> 75.
%t Nest[Append[#, Mod[1 + {#2, #1}, 10] & @@ #[[-1]]] &, {{2, 4}}, 42] // Flatten (* _Michael De Vlieger_, Jul 01 2018 *)
%o (PARI) { f="b061728.txt"; for (n=1, 500, if (n==1, a=2; b=4, s=a; a=(b + 1)%10; b=(s + 1)%10); write(f, 2*n - 1, " ", a); write(f, 2*n, " ", b) ) } \\ _Harry J. Smith_, Jul 27 2009
%o (PARI) Vec(x*(2 + 2*x + 3*x^2 + 4*x^4 + 2*x^5 + 5*x^6 + 6*x^8 + 2*x^9 + 7*x^10 + 8*x^12 - 8*x^13 + 9*x^14 + 2*x^17 + x^18) / ((1 - x)*(1 + x^2)*(1 - x + x^2 - x^3 + x^4)*(1 + x + x^2 + x^3 + x^4)*(1 - x^2 + x^4 - x^6 + x^8)) + O(x^150)) \\ _Colin Barker_, Jul 02 2018
%Y Cf. A061729.
%K nonn,easy,base
%O 1,1
%A _Jason Earls_, May 06 2001
%E More terms from Larry Reeves (larryr(AT)acm.org), May 07 2001
%E Offset changed from 24 to 1 by _Harry J. Smith_, Jul 27 2009
%E Name edited by _David A. Corneth_ and _Jon E. Schoenfield_, Jul 05 2018
%E Edited by _N. J. A. Sloane_, Jul 06 2018