cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097962 Slowest increasing sequence where the digits, taken one by one, show the pattern even/odd/even/odd/even...

This page as a plain text file.
%I A097962 #11 Dec 09 2024 11:55:37
%S A097962 0,1,2,3,4,5,6,7,8,9,21,23,25,27,29,41,43,45,47,49,61,63,65,67,69,81,
%T A097962 83,85,87,89,210,301,410,501,610,701,810,901,2101,2103,2105,2107,2109,
%U A097962 2121,2123,2125,2127,2129,2141,2143,2145,2147,2149,2161,2163,2165,2167,2169
%N A097962 Slowest increasing sequence where the digits, taken one by one, show the pattern even/odd/even/odd/even...
%C A097962 Distinct from A098951, which is not required to be increasing. The first 31 terms are identical, but here a(30) = 210 must be followed by a(31) = 301, while there 210 is followed by 10. - _M. F. Hasler_, Mar 23 2019
%H A097962 M. F. Hasler, <a href="/A097962/b097962.txt">Table of n, a(n) for n = 0..10000</a>
%t A097962 nn = 57; c[_] := False; a[0] = j = 0; p = 1; c[0] = True;
%t A097962 Do[k = j;
%t A097962   While[(Set[q, Mod[#[[-1]], 2]];
%t A097962     Nand[! c[k], Mod[#[[1]], 2] == p,
%t A097962     Union[Length /@ SplitBy[#, EvenQ]] == {1}]) &[IntegerDigits[k]],
%t A097962     k++]; Set[{a[n], j, p, c[k]}, {k, k, 1 - q, True}], {n, nn}];
%t A097962 Array[a, nn + 1, 0] (* _Michael De Vlieger_, Dec 09 2024 *)
%o A097962 (PARI) nxt(n,d=digits(n))={if(!bittest(#d,0), forstep(i=#d,1,-1, 10>(d[i]+=2)&& return(fromdigits(d)); d[i]-=10);  d||return(1); d[#d]=if(d[1]%=2,10,21); fromdigits(Vecrev(d)), 10>d[1]+=1, d[1]=d[1]*10+d[#d]; fromdigits(d)\10, d[1]=21; fromdigits(d))}
%o A097962 vector(50,i,t=if(i>1,nxt(t),0)) \\ _M. F. Hasler_, Mar 23 2019
%K A097962 nonn,base
%O A097962 0,3
%A A097962 _Eric Angelini_, Sep 06 2004