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-4 of 4 results.

A045877 Rotating digits of a(n)^2 right once still yields a square.

Original entry on oeis.org

1, 2, 3, 16, 21, 31, 129, 221, 247, 258, 1062, 1593, 1964, 2221, 13516, 17287, 18516, 19821, 22221, 28064, 29631, 103764, 182362, 222221, 273543, 1246713, 1509437, 1635219, 1856538, 2222221, 2253804, 2749249, 2784807, 11619096, 11949507
Offset: 1

Views

Author

Keywords

Comments

Squares resulting in leading zeros excluded.
(2*10^k-11)/9 are terms, i.e. A165402 is a subsequence. - Chai Wah Wu, Apr 23 2022

Examples

			13516^2 = 18268225{6} -> {6}18268225 = 24865^2.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A045877_gen(): # generator of terms
        for l in count(0):
            l1, l2 = 10**(l+1), 10**l
            yield from sorted(set(abs(x) for z in (diop_DN(10,m*(1-l1)) for m in range(10)) for x, y in z if l1 >= x**2 >= l2))
    A045877_list = list(islice(A045877_gen(),30)) # Chai Wah Wu, Apr 23 2022

Extensions

More terms from Patrick De Geest, Nov 15 1998

A035129 Rotating digits of a(n)^3 left once still yields a cube.

Original entry on oeis.org

1, 2, 8, 457
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Cubes resulting in leading zeros excluded.

Examples

			457^3 = 95443993 -> 54439939 = 379^3.
		

Crossrefs

A035127 Squares which when digits are rotated left once remain square.

Original entry on oeis.org

1, 4, 9, 144, 196, 625, 11664, 14884, 46656, 96100, 1493284, 4112784, 6385729, 9253764, 139287204, 149377284, 187799616, 618268225, 634284225, 678758809, 929884036, 14938217284, 43325589904, 61076696769, 97482577284
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Those resulting in leading zeros are excluded.

Examples

			2527^2 = 6385729 -> 3857296 = 1964^2.
		

Crossrefs

Subsequence of A000290.

Programs

  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n]},idn[[2]]!=0&&IntegerQ[Sqrt[ FromDigits[RotateLeft[idn]]]]]; Join[{1,4,9},Select[Range[4,320000]^2, okQ]] (* Harvey P. Dale, Apr 30 2011 *)
  • Python
    from itertools import count, islice
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A035127_gen(): # generator of terms
        for l in count(0):
            l1, l2 = 10**(l+1), 10**l
            yield from sorted(set(y**2 for z in (diop_DN(10,m*(1-l1)) for m in range(10)) for x, y in z if l1 >= x**2 >= l2))
    A035127_list = list(islice(A035127_gen(),20)) # Chai Wah Wu, Apr 23 2022

A245584 Let f(m) put the leftmost digit of the positive integer m at its end; a(n) is the sequence of all positive integers m with f^2(m)=f(m^2).

Original entry on oeis.org

1, 2, 3, 12, 122, 1222, 12222, 122222, 1222222, 12222222, 122222222
Offset: 1

Views

Author

Reiner Moewald, Jul 26 2014

Keywords

Examples

			122^2=14884 and 221^2=48841.
		

Crossrefs

Programs

  • Mathematica
    f[m_Integer] := Module[{w}, w := IntegerDigits[m]; FromDigits[Rest[AppendTo[w, First[w]]]]]; a245584[n_Integer] :=
    Select[Range[n], If[f[#]^2 == f[#^2] && ! Mod[#, 10] == 0, True, False] &]; a245584[10^5] (* Michael De Vlieger, Aug 17 2014 *)
  • Python
    import math
    max = 10000
    print('los')
    for n in range(1, max):
       nst = str(n*n)
       nnewst = nst[1:] + nst[0]
       d = int(nnewst)
       e = int(math.sqrt(d))
       est = str(e)
       enewst = est[len(est)-1] + est[:len(est)-1]
       if (e * e == d) and (nnewst[0] != "0") and (str(n) == enewst):
          print(n, '  ',  e)
    print('End.')

Formula

One can easily prove that all integers of the form 12...2 are elements of the sequence.
Showing 1-4 of 4 results.