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 21-27 of 27 results.

A281823 Least number k such that (k-n)^2 contains k as a substring.

Original entry on oeis.org

1, 12, 1, 16, 108, 1, 4, 2, 116, 3, 1, 1, 1, 1, 1, 1, 4, 2, 2, 2, 1, 3, 1, 9, 4, 2, 4, 2, 5, 2, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 3, 2, 1, 3, 1, 2, 3, 3, 3, 2, 4, 3, 1, 4, 1, 1, 4, 2, 3, 2, 4, 2, 1, 2, 1, 4, 2, 6
Offset: 0

Views

Author

Paolo P. Lava, Jan 31 2017

Keywords

Examples

			a(1) = 12 because (12 - 1)^2 = 11^2 = 121 contains 12 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);
  • Mathematica
    nk[n_]:=Module[{k=1},While[SequenceCount[IntegerDigits[(k-n)^2],IntegerDigits[ k]]==0,k++];k]; Array[lnk,90,0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 13 2021 *)

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.

A295900 Numbers n such that n^3 contains the consecutive substring 2,3,5,7.

Original entry on oeis.org

1331, 3108, 3176, 4093, 4643, 5846, 6178, 6797, 9175, 10731, 13076, 13245, 13309, 13310, 14093, 14526, 16291, 17852, 20095, 20791, 21835, 23635, 23766, 24093, 28452, 28672, 28673, 28674, 28675, 29211, 31080, 31760, 33907, 34093, 34986, 36449, 38538, 38599, 39526
Offset: 1

Views

Author

K. D. Bajpai, Nov 29 2017

Keywords

Examples

			1331 is in the sequence because 1331^3 = 2357947691 contains substring of prime digits "2357".
3108 is in the sequence because 3108^3 = 30022235712 contains substring of prime digits "2357".
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100000], MemberQ[Partition[IntegerDigits[#^3], 4, 1], {2, 3, 5, 7}] &]
  • PARI
    isok(n) = {c = n^3; ret = 0; while (c > 1, if ((c % 10000) == 2357, ret = 1; break); c = floor(c/10);); return (ret);} \\ Michel Marcus, Dec 15 2017
    
  • Python
    A295900_list = [n for n in range(1,10**6) if '2357' in str(n**3)] # Chai Wah Wu, Feb 09 2018

A342468 Number of multiples of n up to n^2 containing the substring n in base 10.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 8, 2, 2, 3, 2, 4, 2, 3, 2, 2, 3, 3, 2, 2, 2, 10, 2, 3, 2, 3, 4, 2, 2, 4, 2, 28, 2, 4, 3, 3, 4, 5, 2, 3, 4, 14, 2, 3, 3, 5, 5, 3, 3, 4, 4, 8, 2, 5, 2, 3, 21, 5, 7, 3, 3, 19, 2, 4, 2, 6, 6, 3
Offset: 1

Views

Author

Yi-Hsuan Hsu, Mar 13 2021

Keywords

Comments

Since the definition includes n, a(n) >= 1.
Called "Self-Replicating Numbers": "An n-order self-replicating number appears as a substring in exactly n multiples of itself up to its square, including itself" (Zaelin Goodman's Code Golf post).
There are exactly six 1st-order numbers (1, 2, 3, 4, 7, and 9).
Any number n always has an order a(n) >= log_10(n) (when n < 10, floor(log_10(n))=0). This is because there will always be at least one multiple where n is a substring (n itself), as well as any multiples of 10*n (n followed by any number of zeros).
Due to the above, for all integers x >= 1, the series of x-order self-replicating numbers is finite; a(n)=x for the last time at n=10^x-1.
For example, consider a(9)=1. It is the last possible order 1 because the only multiples where 9 is a substring are multiples of 10 (90, 900, ...), which are all > 9^2.

Examples

			a(5) = 3 because (5, 15, 25) contain 5 as a substring.
a(20) = 5 because (20, 120, 200, 220, 320) contain 20 as a substring.
		

Crossrefs

Cf. A018834.

Programs

A370004 Least k>0 such that the decimal expansion of k^2 contains k+n as a substring.

Original entry on oeis.org

1, 11, 2, 13, 104, 14, 3, 15, 108, 16, 11, 17, 4, 39, 18, 77, 760, 19, 52, 117, 5, 118, 34, 21, 120, 121, 22, 41, 123, 23, 6, 125, 12, 24, 42, 128, 504, 25, 352, 130, 16, 26, 7, 133, 377, 27, 322, 135, 136, 44, 26, 393, 24, 747, 139, 29, 8, 141, 108, 142, 30, 143, 22, 144, 380, 31, 606, 146, 1064, 147, 32
Offset: 0

Views

Author

Giorgos Kalogeropoulos, Feb 07 2024

Keywords

Comments

This sequence is defined for all n. Proof: Given n, consider k = 10^x + n where 10^x > n^2. Since k^2 = (k+n) * 10^x + n^2, k^2 contains k+n as a substring. Furthermore, x = ceiling(log_10(1+n^2)) satisfies the inequality, therefore a(n) <= 10^ceiling(log_10(1+n^2)) + n. - Jason Yuen, Feb 26 2024

Examples

			a(3) = 13 because 13 is the least positive integer such that 13^2 = 169 contains 13 + 3 = 16 as a substring.
a(4) = 104 because 104 is the least positive integer such that 104^2 = 10816 contains 104 + 4 = 108 as a substring.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1;While[!StringContainsQ[ToString[k^2],ToString[k+n]],k++];k,{n,0,70}]
    lks[n_]:=Module[{k=1},While[SequenceCount[IntegerDigits[k^2],IntegerDigits[k+n]]==0,k++];k]; Array[lks,80,0] (* Harvey P. Dale, May 26 2025 *)
  • PARI
    a(n) = my(k=1); while (#strsplit(Str(k^2), Str(k+n))<2, k++); k; \\ Michel Marcus, Feb 07 2024
    
  • Python
    from itertools import count
    def a(n): return next(k for k in count(1) if str(k+n) in str(k*k))
    print([a(n) for n in range(71)]) # Michael S. Branicky, Feb 07 2024

A385709 Least prime p such that the decimal expansion of p^2 contains exactly n distinct primes as substrings.

Original entry on oeis.org

11, 5, 23, 61, 73, 239, 487, 523, 569, 3461, 1319, 3373, 8923, 4937, 12619, 11489, 15569, 32189, 105173, 135319, 46619, 56473, 177127, 234161, 295861, 471923, 664319, 2366387, 3183613, 1092389, 3513877, 7702319, 4632077, 10666177, 13977923, 20825939, 35821939
Offset: 1

Views

Author

Zhining Yang, Jul 07 2025

Keywords

Examples

			a(9) = 569 because 569^2 = 323761, which contains 9 distinct primes as substring:{2,3,7,23,37,61,761,3761,23761}, and no prime less than 569 has 9 solutions.
		

Crossrefs

Programs

  • Mathematica
    b = Table[{}, 9]; Do[d = IntegerDigits[p^2];
     t = Union@Select[FromDigits /@ Flatten[Table[Partition[d, k, 1], {k, Length@d}], 1], PrimeQ]; c = Length@t;
     If[b[[c]] == {}, b[[c]] = {p, p^2, t, c}], {p, Prime@Range@120}]; b // Grid

A161783 Squares n^2 whose decimal expansion contains n as a substring.

Original entry on oeis.org

1, 25, 36, 100, 625, 2500, 3600, 5776, 10000, 62500, 141376, 250000, 360000, 390625, 577600, 1000000, 6250000, 14137600, 14379264, 25000000, 36000000, 39062500, 57760000, 87909376, 100000000, 214651801, 625000000, 1413760000, 2500000000
Offset: 1

Views

Author

Claudio Meller, Jun 19 2009

Keywords

Comments

14379264 is in the list because 14379264 = 3792^2 and 3792 is a substring of 14379264.

Examples

			1 contains its square root (1); 25 contains its square root (5); 3600 contains -- but does not end with -- its square root (60). - _Dominick Cancilla_, Jul 20 2010
		

Crossrefs

Equals A018834^2. Cf. A035383.

Programs

  • Mathematica
    fQ[n_] := StringPosition[ IntegerString[n^2], IntegerString@n] != {}; lst = {}; k = 1; While[k < 50001, If[ fQ@k, AppendTo[lst, k^2]]; k++ ]; lst (* Robert G. Wilson v, Jul 23 2010 *)

Extensions

Edited by N. J. A. Sloane, Jul 23 2010

A179782 Numbers n such that the decimal representation of n is contained as substring in that of the n-th pentagonal number.

Original entry on oeis.org

0, 1, 5, 7, 25, 67, 482, 551, 625, 667, 2937, 6667, 9284, 9376, 9649, 48179, 49900, 55712, 66667, 89517, 90625, 161579, 631206, 666667, 890625, 1348613, 2089517, 3863187, 4999000, 6666667, 7109376, 7477735, 8575619, 10721030, 12890625
Offset: 1

Views

Author

Jonathan Vos Post, Jul 27 2010

Keywords

Comments

This is to pentagonal numbers A000326 as A119238 is to triangular numbers A000217 and as A018834 is to squares A000290. All numbers of the form (10^n-1)/3*2+1 are contained in this list {1, 7, 67, 667, 6667, 66667, 666667, 6666667, 66666667, ...} Alois P. Heinz. Extension: Values 8-25 by Claudio Meller, 26-37 by D. S. McNeil.

Examples

			The 5th pentagonal number, 35, which contains 5.
The 7th pentagonal number, 70, which contains 7.
The 25th pentagonal number, 925, which contains 25.
The 67th pentagonal number, 6700, which contains 67.
The 482nd pentagonal number, 348245, which contains 482.
The 667th pentagonal number, 667000, which contains 667.
		

Crossrefs

Programs

  • Sage
    [n for n in range(10**4) if str(n) in str((3*n**2-n)//2)]

Extensions

Code clarified by D. S. McNeil, Aug 08 2010
Previous Showing 21-27 of 27 results.