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

A018834 Numbers k such that the decimal expansion of k^2 contains k as a substring.

Original entry on oeis.org

0, 1, 5, 6, 10, 25, 50, 60, 76, 100, 250, 376, 500, 600, 625, 760, 1000, 2500, 3760, 3792, 5000, 6000, 6250, 7600, 9376, 10000, 14651, 25000, 37600, 50000, 60000, 62500, 76000, 90625, 93760, 100000, 109376, 250000, 376000, 495475, 500000, 505025
Offset: 1

Views

Author

Keywords

Examples

			25^2 = 625 which contains 25.
3792^2 = 14_3792_64, 14651^2 = 2_14651_801.
		

Crossrefs

Cf. A000290. Supersequence of A029943.
Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9).
Cf. A029942 (cubes), A075904 (4th powers), A075905 (5th powers).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a018834 n = a018834_list !! (n-1)
    a018834_list = filter (\x -> show x `isInfixOf` show (x^2)) [0..]
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Mathematica
    Select[Range[510000], MemberQ[FromDigits /@ Partition[IntegerDigits[#^2], IntegerLength[#], 1], #] &] (* Jayanta Basu, Jun 29 2013 *)
    Select[Range[0,510000],StringPosition[ToString[#^2],ToString[#]]!={}&] (* Ivan N. Ianakiev, Oct 02 2016 *)
  • Python
    from itertools import count, islice
    def A018834_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:str(n) in str(n**2), count(max(startvalue,0)))
    A018834_list = list(islice(A018834_gen(),20)) # Chai Wah Wu, Apr 04 2023

A018826 Numbers n such that n is a substring of its square when both are written in base 2.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 27, 32, 41, 54, 64, 82, 108, 128, 145, 164, 165, 256, 283, 290, 328, 487, 512, 545, 566, 580, 974, 1024, 1090, 1132, 1160, 1773, 1948, 2048, 2113, 2180, 2320, 2701, 3546, 3896, 4096, 4226, 4261, 4360, 4757, 5402, 7092, 7625, 8079, 8192
Offset: 1

Views

Author

Keywords

Comments

Complement of A136492. - Reinhard Zumkeller, Jan 01 2008
A136510(a(n)) = 2 for n>0. - Reinhard Zumkeller, Jan 03 2008
From Robert Israel, Jul 11 2018: (Start)
Contains A000079.
If x satisfies x^2 == 8*x + 1 (mod 2^m) and 0 < x < 2^(m-3) then x is in the sequence. Note that x^2 == 8*x + 1 has 4 solutions mod 2^m for m >= 3. Terms obtained in this way include 27, 283, 1773, 9965, 55579, 206573, .... (End)

Examples

			27 in binary is 11011 and 27^2 = 729 in binary is 1011011001 which has substring 11011. - _Michael Somos_, Mar 16 2015
		

Crossrefs

Cf. A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9), A018834 (base 10).

Programs

  • Maple
    filter:= proc(n) local S,S2;
        S:= convert(convert(n,binary),string);
        S2:= convert(convert(n^2,binary),string);
        StringTools:-Search(S,S2)<>0
    end proc:
    select(filter, [$0..10000]); # Robert Israel, Jul 11 2018
  • Mathematica
    Select[Range[0, 8192], {} != SequencePosition @@ IntegerDigits[{#^2, #}, 2] &] (* Giovanni Resta, Aug 20 2018 *)
    Select[Range[0,10000],SequenceCount[IntegerDigits[#^2,2],IntegerDigits[#,2]]>0&] (* Harvey P. Dale, May 03 2022 *)
  • PARI
    issub(b, bs, k) = {for (i=1, #b, if (b[i] != bs[i+k-1], return (0));); return (1);}
    a076141(n) = {if (n, b = binary(n), b = [0]); if (n, bs = binary(n^2), bs = [0]); sum(k=1, #bs - #b +1, issub(b, bs, k));}
    lista(nn) = for (n=0, nn, if (a076141(n) == 1, print1(n, ", "))); \\ Michel Marcus, Mar 15 2015
    
  • Python
    def ok(n): return bin(n)[2:] in bin(n**2)[2:]
    print([k for k in range(9999) if ok(k)]) # Michael S. Branicky, Apr 04 2024

A018828 Numbers n such that n is a substring of its square (both n and n squared in base 4) (written in base 10).

Original entry on oeis.org

0, 1, 4, 16, 41, 54, 64, 164, 165, 256, 290, 487, 545, 566, 1024, 1160, 1948, 2180, 3546, 4096, 4226, 4261, 7625, 8321, 8720, 9514, 13813, 13867, 15913, 16158, 16384, 16904, 33284, 46126, 54854, 55468, 63652, 64632, 65536, 66050, 67616, 113047, 130591
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0,150000],SequenceCount[IntegerDigits[#^2,4],IntegerDigits[#,4]]>0&] (* Harvey P. Dale, Aug 13 2023 *)

Extensions

Definition clarified by Harvey P. Dale, Aug 13 2023

A018829 Numbers n such that n is a substring of its square in base 5 (written in base 10).

Original entry on oeis.org

0, 1, 5, 14, 25, 38, 125, 349, 408, 543, 625, 3125, 4743, 5292, 10888, 12196, 13201, 15625, 25509, 26460, 36536, 43614, 55038, 57837, 78125, 136888, 207889, 219698, 234783, 390625, 445663, 1090347, 1098490, 1336564, 1437874, 1720752, 1915227
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0,2*10^6],SequenceCount[IntegerDigits[ #^2,5],IntegerDigits[ #,5]]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 04 2019 *)

A018830 Numbers n such that n is a substring of its square in base 6 (written in base 10).

Original entry on oeis.org

0, 1, 3, 4, 6, 9, 18, 24, 28, 36, 54, 81, 108, 136, 144, 168, 216, 324, 486, 648, 816, 864, 1008, 1216, 1296, 1944, 2916, 3888, 4896, 5184, 6048, 6458, 6561, 7296, 7776, 8451, 11664, 16768, 17496, 22779, 23328, 23985, 29376, 29889, 31104, 34299, 34549, 36288
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018831 (base 7), A018832 (base 8), A018833 (base 9), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0, 10^5], StringContainsQ[IntegerString[#^2, 6], IntegerString[#, 6]] &] (* Paolo Xausa, Apr 05 2024 *)

A018831 Numbers n such that n is a substring of its square in base 7 (written in base 10).

Original entry on oeis.org

0, 1, 7, 30, 49, 285, 343, 911, 1900, 2208, 2401, 13962, 16807, 59763, 64098, 69128, 85880, 97734, 117649, 195032, 418341, 754422, 823543, 2162126, 2629229, 2790841, 3488518, 3842400, 4960401, 5764801, 7923812, 8559490, 15134882, 19765943, 31466333, 36415297
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018832 (base 8), A018833 (base 9), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0, 10^7], StringContainsQ[IntegerString[#^2, 7], IntegerString[#, 7]] &] (* Paolo Xausa, Apr 05 2024 *)

Extensions

a(35)-a(36) from Pontus von Brömssen, Apr 04 2024

A018832 Numbers n such that n is a substring of its square in base 8 (written in base 10).

Original entry on oeis.org

0, 1, 8, 27, 64, 283, 290, 512, 545, 1948, 2320, 4096, 4360, 8452, 13813, 16158, 16642, 23063, 26139, 27427, 27734, 32768, 33025, 67616, 87723, 110503, 129264, 130591, 133136, 184504, 206573, 226094, 262144, 264200, 526340, 701784, 1044728, 1050626
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018833 (base 9), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0, 10^6], StringContainsQ[IntegerString[#^2, 8], IntegerString[#, 8]] &] (* Paolo Xausa, Apr 05 2024 *)

A018833 Numbers n such that n is a substring of its square in base 9 (written in base 10).

Original entry on oeis.org

0, 1, 9, 32, 43, 81, 287, 706, 729, 4170, 6561, 30433, 37530, 38669, 42783, 59049, 99543, 192211, 281782, 394981, 415578, 531441, 561785, 666112, 1723076, 2046242, 3039924, 3485488, 4782969, 8684182, 11512384, 12684634, 18346925, 19988197, 29728486, 31190295
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018834 (base 10).

Programs

  • Mathematica
    Select[Range[0, 10^7], StringContainsQ[IntegerString[#^2, 9], IntegerString[#, 9]] &] (* Paolo Xausa, Apr 05 2024 *)

Extensions

a(35)-a(36) from Pontus von Brömssen, Apr 04 2024
Showing 1-8 of 8 results.