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.

Showing 1-6 of 6 results.

A030153 Numbers k such that in k and k^2 the parity of digits alternates.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 16, 23, 27, 36, 69, 74, 81, 96, 127, 181, 187, 296, 874, 2327, 2369, 2723, 2727, 2763, 3816, 4589, 5874, 6563, 6589, 6727, 8323, 10181, 12723, 18163, 18587, 21236, 21274, 29236, 29274, 30127, 43296, 52361, 78163, 87616
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@n, 2], 2, 1]] == {1}; Select[ Range[0, 10^5], altQ[#] && altQ[#^2] &] (* Giovanni Resta, Aug 16 2018 *)

A030154 Squares such that in n and sqrt(n) the parity of digits alternates.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 81, 256, 529, 729, 1296, 4761, 5476, 6561, 9216, 16129, 32761, 34969, 87616, 763876, 5414929, 5612161, 7414729, 7436529, 7634169, 14561856, 21058921, 34503876, 43072969, 43414921, 45252529, 69272329
Offset: 1

Views

Author

Keywords

Comments

The more digits there are in n, the lower the likelihood that the parity of n's digits will strictly alternate. Thus, the terms of the sequence become increasingly rare as n gets larger. - Harvey P. Dale, Aug 05 2018
For n > 3 the last digit of a(n) isn't 0 or 4. - David A. Corneth, Aug 05 2018

Crossrefs

Programs

  • Mathematica
    pdaQ[n_]:=Module[{a=Mod[IntegerDigits[n],2],b=Mod[IntegerDigits[ Sqrt[ n]],2]},Length[ Split[a]] ==IntegerLength[n]&&Length[Split[b]]== IntegerLength[ Sqrt[n]]]; Join[{0},Select[Range[8500]^2,pdaQ]] (* Harvey P. Dale, Aug 05 2018 *)
  • PARI
    alternating(n)={my(v=digits(n)%2);0==#select(i->v[i]==v[i-1],[2..#v])}
    { for(n=0, 10^5, if(alternating(n^2) && alternating(n), print1(n^2, ", "))) } \\ Andrew Howroyd, Aug 05 2018
    
  • PARI
    \\ for larger n: requires alternating function above
    upto(n)={local(R=List([0])); my(recurse(s,b)=if(b0&&alternating(k^2\b), listput(R, k)); self()(k, 10*b)))))); recurse(0,1); listsort(R); Vec(R)}
    apply(n->n^2, upto(sqrtint(10^12))) \\ Andrew Howroyd, Aug 05 2018

Extensions

Offset changed by David A. Corneth, Aug 05 2018

A030156 Odd squares in which parity of digits alternates.

Original entry on oeis.org

1, 9, 25, 49, 81, 121, 169, 361, 529, 729, 961, 4761, 6561, 12321, 12769, 14161, 16129, 18769, 32761, 34969, 56169, 72361, 74529, 76729, 78961, 96721, 212521, 214369, 290521, 436921, 452929, 458329, 474721, 670761, 690561, 1038361
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@n, 2], 2, 1]] == {1}; Select[ Range[1, 2000, 2]^2, altQ[#] &] (* Giovanni Resta, Aug 16 2018 *)

Extensions

Offset changed by Giovanni Resta, Aug 16 2018

A030159 Numbers n such that in n^3 the parity of digits alternates.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 9, 18, 23, 85, 87, 101, 103, 168, 206, 301, 303, 363, 725, 1683, 2461, 2788, 7921, 9563, 9668, 20606, 28443, 29501, 45168, 46701, 49501, 63556, 78206, 80901, 90009, 167861, 168069, 208288, 278636, 331841, 375121, 440468
Offset: 1

Views

Author

Keywords

Comments

A simple heuristic argument suggests that this sequence (albeit rather sparse) is infinite. The numbers of terms of k digits, for k=1..14, are 8, 4, 8, 6, 10, 14, 20, 18, 33, 23, 42, 37, 46, 77, respectively. The 5 numbers obtained multiplying the first h=1..5 terms of (1+10^2, 1+10^8, 1+10^32, 1+10^128, 1+10^512), are all member of the sequence. The largest one is a number of 683 digits whose alternating cube has 2047 digits. - Giovanni Resta, Aug 16 2018

Crossrefs

Programs

  • Mathematica
    n3pdaQ[n_]:=Module[{pty=Boole[EvenQ/@IntegerDigits[n^3]],len= IntegerLength[ n^3]}, pty== PadRight[{},len,{1,0}]||pty==PadRight[ {}, len, {0,1}]]; Join[{0},Select[Range[450000],n3pdaQ]] (* Harvey P. Dale, Mar 26 2018 *)

A030145 Primes such that in p^2 the parity of digits alternates.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 23, 31, 113, 127, 137, 181, 269, 277, 281, 311, 461, 463, 661, 673, 677, 1019, 1277, 1361, 1973, 2287, 2339, 2377, 2411, 2423, 2689, 2731, 4673, 5023, 5081, 5261, 6563, 6577, 8311, 9013, 9437, 9439, 10181, 10463
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    id[n_]:=IntegerDigits[n]; t={}; Do[p=Prime[n]; If[Length[id[p]]==1,AppendTo[t,p], If[Union[Abs[Differences[Boole/@EvenQ[id[p^2]]]]]=={1}, AppendTo[t,p]]], {n,1300}]; t (* Jayanta Basu, May 07 2013 *)
    pdaQ[n_]:=FreeQ[Differences[Boole[EvenQ[IntegerDigits[n^2]]]],0]; Select[ Prime[ Range[1300]],pdaQ] (* Harvey P. Dale, Jul 30 2019 *)

Formula

a(n)^2 = A030146(n). - Giovanni Resta, Aug 16 2018

Extensions

Offset corrected by Giovanni Resta, Aug 16 2018

A030155 Odd n such that in n^2 the parity of digits alternates.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 19, 23, 27, 31, 69, 81, 111, 113, 119, 127, 137, 181, 187, 237, 269, 273, 277, 281, 311, 461, 463, 539, 661, 673, 677, 689, 819, 831, 1019, 1027, 1111, 1113, 1119, 1127, 1137, 1269, 1277, 1287, 1361, 1369, 1377, 1863, 1969
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@n, 2], 2, 1]] == {1}; Select[ Range[1, 2000, 2], altQ[#^2] &] (* Giovanni Resta, Aug 16 2018 *)

Extensions

Offset changed by Giovanni Resta, Aug 16 2018
Showing 1-6 of 6 results.