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.

Previous Showing 11-20 of 27 results. Next

A046831 Numbers k such that decimal expansion of k^2 contains k as a substring and k does not end in 0.

Original entry on oeis.org

1, 5, 6, 25, 76, 376, 625, 3792, 9376, 14651, 90625, 109376, 495475, 505025, 890625, 971582, 1713526, 2890625, 4115964, 5133355, 6933808, 7109376, 10050125, 12890625, 48588526, 50050025, 66952741, 87109376, 88027284, 88819024
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A018834. - Chai Wah Wu, Apr 04 2023

Crossrefs

Programs

  • Haskell
    a046831 n = a046831_list !! (n-1)
    a046831_list = filter ((> 0) . (`mod` 10)) a018834_list
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Mathematica
    Reap[For[n = 1, n < 10^8, n++, If[Mod[n, 10] != 0, If[StringPosition[ToString[n^2], ToString[n]] != {}, Print[n]; Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Apr 04 2013 *)
  • Python
    from itertools import count, islice
    def A046831_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:n%10 and str(n) in str(n**2), count(max(startvalue,0)))
    A046831_list = list(islice(A046831_gen(),20)) # Chai Wah Wu, Apr 04 2023

A046851 Numbers n such that n^2 can be obtained from n by inserting internal (but not necessarily contiguous) digits.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 105, 110, 125, 950, 960, 976, 995, 996, 1000, 1001, 1005, 1006, 1010, 1011, 1021, 1025, 1026, 1036, 1046, 1050, 1100, 1101, 1105, 1201, 1205, 1250, 1276, 1305, 1316, 1376, 1405, 9500, 9505, 9511, 9525, 9600, 9605, 9625
Offset: 1

Views

Author

Keywords

Comments

Contains A038444. In particular, the sequence is infinite. - Robert Israel, Oct 20 2016
If n is any positive term, then b_n(k) := n*10^k (k >= 0) is an infinite subsequence. - Rick L. Shepherd, Nov 01 2016
From Robert Israel's comment it follows that the subsequence of terms with no trailing zeros is also infinite (contains A000533). - Rick L. Shepherd, Nov 01 2016

Examples

			110^2 = 12100 (insert "2" and "0" into "1_1_0").
		

Crossrefs

Cf. A045953, A008851, A018834, A038444, A086457 (subsequence).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a046851 n = a046851_list !! (n-1)
    a046851_list = filter chi a008851_list where
       chi n = (x == y && xs `isSub` ys) where
          x:xs = show $ div n 10
          y:ys = show $ div (n^2) 10
       isSub [] ys       = True
       isSub _  []       = False
       isSub us'@(u:us) (v:vs)
             | u == v    = isSub us vs
             | otherwise = isSub us' vs
    -- Reinhard Zumkeller, Jul 27 2011
  • Maple
    IsSublist:= proc(a, b)
      local i,bp,j;
      bp:= b;
      for i from 1 to nops(a) do
        j:= ListTools:-Search(a[i],bp);
        if j = 0 then return false fi;
        bp:= bp[j+1..-1];
      od;
      true
    end proc:
    filter:= proc(n) local A,B;
      A:= convert(n,base,10);
      B:= convert(n^2,base,10);
      if not(A[1] = B[1] and A[-1] = B[-1]) then return false fi;
      if nops(A) <= 2 then return true fi;
      IsSublist(A[2..-2],B[2..-2])
    end proc:
    select(filter, [$0..10^4]); # Robert Israel, Oct 20 2016
  • Mathematica
    id[n_]:=IntegerDigits[n];
    insQ[n_]:=First[id[n]]==First[id[n^2]]&&Last[id[n]]==Last[id[n^2]];
    sort[n_]:=Flatten/@Table[Position[id[n^2],id[n][[i]]],{i,1,Length[id[n]]}];
    takeQ[n_]:=Module[{lst={First[sort[n][[1]]]}},
       Do[
        Do[
         If[Last[lst]Ivan N. Ianakiev, Oct 19 2016 *)

A029943 Substring of both its square and its cube.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Intersection of A018834 and A029942. - Reinhard Zumkeller, Feb 29 2012

Programs

  • Haskell
    import Data.List (isInfixOf)
    a029943 n = a029943_list !! (n-1)
    a029943_list = filter f [0..] where
       f x = show x `isInfixOf` show (x^2) && show x `isInfixOf` show (x^3)
    -- Reinhard Zumkeller, Nov 26 2011
  • Mathematica
    ssscQ[n_]:=Module[{idn=IntegerDigits[n],sq=IntegerDigits[n^2], cu=IntegerDigits[n^3],len=IntegerLength[n]},MemberQ[Partition[ sq,len,1], idn] &&MemberQ[Partition[cu,len,1],idn]]; Join[{0}, Select[Range[700000],ssscQ]] (* Harvey P. Dale, Apr 24 2011 *)

Formula

a(n) = A003226(m) * 10^k for appropriate m and k. [Reinhard Zumkeller, Nov 26 2011]

Extensions

Offset corrected by Reinhard Zumkeller, Nov 26 2011

A089951 Numbers having the same leading decimal digits as their squares.

Original entry on oeis.org

0, 1, 10, 11, 12, 13, 14, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 895
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 12 2004

Keywords

Comments

A000030(a(n)) = A002993(a(n)) = A000030(A000290(a(n))).

Examples

			895*895 = 801025, therefore 895 is a term: a(55)=895.
		

Crossrefs

Cf. A018834.
Cf. A144582. - Reinhard Zumkeller, Aug 17 2008
Cf. A000030, A002993, A000290, A256523 (subsequence).

Programs

  • Haskell
    a089951 n = a089951_list !! (n-1)
    a089951_list = [x | x <- [0..], a000030 x == a000030 (x ^ 2)]
    -- Reinhard Zumkeller, Apr 01 2015
  • Maple
    F:= proc(d) $10^d .. floor(sqrt(2)*10^d), $ ceil(sqrt(80)*10^d) .. 9*10^d - 1, $ ceil(sqrt(90)*10^d) .. 10^(d+1)-1 end proc:
    0, F(0), F(1), F(2), F(3); # Robert Israel, Mar 18 2015
  • Mathematica
    d[n_] := IntegerDigits[n]; Select[Range[895],
    First[d[#]] == First[d[#^2]] &] (* Jayanta Basu, Jun 03 2013 *)
  • PARI
    a(n)={my(v = [1, sqrt(80), sqrt(90)], w=[(k)->10^k * ((sqrt(2) - 1))\1 + 1, (k)->9 * 10^k - ceil(sqrt(80) * 10^k), (k)->10 * 10^k - ceil(sqrt(90) * 10^k)],i = 1,k = 0); if(n==1, 0, n--; while(n>w[i](k), n-=w[i](k); i++; if(i == 4, i = 1; k++)); ceil(v[i]*10^k)+n-1)} \\ David A. Corneth, Feb 26 2015
    
  • PARI
    isok(n) = (n == 0) || (digits(n)[1] == digits(n^2)[1]); \\ Michel Marcus, Mar 18 2015
    

Formula

A number n is in the sequence iff n = 0 or n/10^floor(log_10(n)) lies in one of the half-open intervals [1, sqrt(2)), [sqrt(80), 9) or [sqrt(90), 10). - David W. Wilson, May 29 2008

A045953 Numbers m such that m^2 can be obtained from m by inserting an internal block of (contiguous) digits.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 125, 976, 995, 996, 1000, 1001, 1025, 1376, 9625, 9976, 9995, 9996, 10000, 10001, 10025, 10376, 10625, 99376, 99625, 99976, 99995, 99996, 100000, 100001, 100025, 100376, 100625, 109376, 990625, 999376, 999625, 999976
Offset: 1

Views

Author

John "MazeMan" Knoderer (Webmaster(AT)Mazes.com)

Keywords

Comments

All terms of this sequence appear in A086457. - Jeremy Gardiner, Jul 20 2003
It seems that for any nonnegative integer k the number of k-digit terms is 2k. - Ivan N. Ianakiev, Aug 17 2021

Examples

			95^2 = 9025 (insert '02' inside '95').
		

Crossrefs

Programs

  • Haskell
    import Data.List (isPrefixOf, inits, isSuffixOf, tails)
    a045953 n = a045953_list !! (n-1)
    a045953_list = filter chi a008851_list where
       chi n = (x == y && xs `isSub'` ys) where
          x:xs = show $ div n 10
          y:ys = show $ div (n^2) 10
          isSub' us vs = any id $ zipWith (&&)
                                  (map (`isPrefixOf` vs) $ inits us)
                                  (map (`isSuffixOf` vs) $ tails us)
    -- Reinhard Zumkeller, Jul 27 2011

A075904 Numbers k such that k^4 has k as a substring of its decimal expansion.

Original entry on oeis.org

0, 1, 5, 6, 10, 25, 50, 60, 76, 83, 92, 100, 107, 211, 217, 250, 352, 363, 376, 500, 556, 600, 625, 636, 760, 863, 909, 935, 1000, 1531, 1636, 2263, 2500, 2503, 3630, 3760, 4342, 5000, 5001, 6000, 6250, 7245, 7600, 8578, 9350, 9376, 10000, 25000, 28206, 32213
Offset: 1

Views

Author

Zak Seidov, Sep 27 2002

Keywords

Examples

			6^4 = 129_6, 83^4 = 4745_83_21, 2503^4 = 39_2503_37770081.
		

Crossrefs

Cf. A018834 (squares), A029942 (cubes), A075905 (5th powers).

Programs

  • Mathematica
    Select[Range[10000], StringPosition[ToString[ #^4], ToString[ # ]] != {} &] (* Tanya Khovanova, Oct 11 2007 *)
    ssQ[n_]:=Module[{idn=IntegerDigits[n],idn4=IntegerDigits[n^4]}, MemberQ[ Partition[ idn4, Length[ idn],1], idn]]; Select[Range[10000],ssQ] (* Harvey P. Dale, Mar 13 2013 *)
  • Python
    A075904_list, m = [0], [24, -36, 14, -1, 0]
    for n in range(1,10**9+1):
        for i in range(4):
            m[i+1] += m[i]
        if str(n) in str(m[-1]):
            A075904_list.append(n) # Chai Wah Wu, Nov 05 2014

Extensions

More terms from Tanya Khovanova, Oct 11 2007
Added 0 to sequence by Chai Wah Wu, Nov 05 2014

A075905 Numbers k such that k^5 has k as a substring of its representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 18, 20, 24, 25, 30, 32, 40, 43, 45, 48, 49, 50, 51, 57, 60, 68, 70, 73, 75, 76, 80, 90, 93, 99, 100, 101, 125, 178, 192, 193, 195, 200, 205, 240, 249, 250, 251, 300, 307, 320, 375, 376, 400, 430, 432, 443, 480, 490, 499, 500, 501
Offset: 1

Views

Author

Zak Seidov, Sep 27 2002

Keywords

Examples

			45^5 = 18_45_28125, 3637^5 = 6_3637_9975073041957, 3975^5 = 992_3975_07802734375.
		

Crossrefs

Cf. A018834 (squares), A029942 (cubes), A075904 (4th powers).

Programs

  • Mathematica
    Select[Range[0,600],SequenceCount[IntegerDigits[#^5],IntegerDigits[#]]>0&] (* Harvey P. Dale, Jul 06 2025 *)
  • Python
    A075905_list, m = [0], [120, -240, 150, -30, 1, 0]
    for n in range(1,10**8+1):
        for i in range(5):
            m[i+1] += m[i]
        if str(n) in str(m[-1]):
            A075905_list.append(n) # Chai Wah Wu, Nov 05 2014

A239058 Numbers whose divisors all appear as a substring in their decimal expansion.

Original entry on oeis.org

1, 11, 13, 17, 19, 31, 41, 61, 71, 101, 103, 107, 109, 113, 125, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 241, 251, 271, 281, 311, 313, 317, 331, 401, 419, 421, 431, 461, 491, 521, 541, 571, 601, 613, 617, 619, 631, 641, 661, 691, 701, 719, 751, 761, 811, 821, 881, 911, 919, 941, 971
Offset: 1

Views

Author

M. F. Hasler, Mar 09 2014

Keywords

Comments

A subsequence of A092911 (all divisors can be formed using the digits of the number) which is a subsequence of A011531 (numbers having the digit 1).
Are 1 and 125 the only nonprime terms in this sequence?
No: 17692313, 4482669527413081, 21465097175420089, and 567533481816008761 are members. - Charles R Greathouse IV, Mar 09 2014
See A239060 for the nonprime terms of this sequence, which include in particular the squares of terms of A115738 (unless such a square would not have a digit 1).

Examples

			All primes having the digit 1 (A208270) are in this sequence, because {1, p} are the only divisors of a prime p.
The divisors of 125 are {1, 5, 25, 125}; it can be seen that all of them occur as a substring in 125, therefore 125 is in this sequence.
		

Crossrefs

Programs

  • PARI
    is(n,d=vecextract(divisors(n),"^-1"))={ setminus(select(x->x<10,d),Set(digits(n)))&&return;!for(L=2,#Str(d[#d]),setminus(select(x->x
    <10^L&&x>=10^(L-1),d),Set(concat(vector(L,o,digits(n\10^(L-o),10^L)))))&&return)}
    
  • PARI
    overlap(long,short)=my(D=10^#digits(short)); while(long>=short, if(long%D==short,return(1));long\=10); 0
    is(n)=my(d=divisors(n)); forstep(i=#d-1,1,-1, if(!overlap(n,d[i]), return(0))); 1 \\ Charles R Greathouse IV, Mar 09 2014

A239060 Nonprime numbers whose divisors all appear as a substring in the number's decimal expansion.

Original entry on oeis.org

1, 125, 17692313
Offset: 1

Views

Author

M. F. Hasler, Mar 09 2014

Keywords

Comments

This is the subsequence of A239058 without the primes having a digit 1, A208270. It is thus a subsequence of A092911 (all divisors can be formed using the digits of the number) which is a subsequence of A011531 (numbers having the digit 1).
The term a(3)=17692313=A239058(870356), as well as the numbers 4482669527413081, 21465097175420089, and 567533481816008761 which are also members, were found by Charles R Greathouse IV, Mar 09 2014
The square of any term of A115738 is a member of this sequence. The above larger examples are of that form.
a(4) > 10^12. - Giovanni Resta, Sep 08 2018

Examples

			The divisors of 17692313 are {1, 23, 769231, 17692313}; it can be seen that all of them occur as a substring in 17692313, therefore 17692313 is in this sequence.
		

Crossrefs

Programs

  • PARI
    is(n)=!isprime(n)&&is_A239058(n)
    
  • PARI
    overlap(long,short)=my(D=10^#digits(short)); while(long>=short, if(long%D==short,return(1));long\=10); 0
    is(n)=my(d=divisors(n)); #d!=2 && !forstep(i=#d-1,1,-1, if(!overlap(n,d[i]), return(0))) \\ Charles R Greathouse IV, Mar 09 2014

A281822 Least number k such that (k+n)^2 contains k as a substring.

Original entry on oeis.org

1, 8, 6, 1, 4, 9, 62, 6, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 1, 5, 1, 2, 9, 2, 4, 2, 92, 9, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 3, 1, 3, 3, 1, 2, 1, 4, 4, 2, 4, 4, 2, 4, 1, 5, 1, 1, 5, 2, 4, 2, 4, 2, 1, 5, 1, 6, 5, 2, 4, 8, 6
Offset: 0

Views

Author

Paolo P. Lava, Jan 31 2017

Keywords

Examples

			a(1) = 8 because (8 + 1)^2 = 9^2 = 81 contains 8 as a substring and it is the least number with this property.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:= proc(q) local a,b,d,j,k,n,ok;
    for n from 0 to q do for k from 1 to q do a:=ilog10(k)+1; b:=(n+k)^2; d:=ilog10((k+n)^2)-ilog10(k)+1;
    ok:=0; for j from 1 to d do if k=(b mod 10^a) then ok:=1; break; else b:=trunc(b/10); fi; od;
    if ok=1 then print(k); break; fi; od; od; end: P(10^6);

Extensions

Typo in definition corrected by Harvey P. Dale, Feb 27 2017.
Entries, Maple code and b-file corrected at the suggestion of Harvey P. Dale, Feb 28 2017.
Previous Showing 11-20 of 27 results. Next