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

A316604 Replacing each digit d in decimal expansion of n with d^2 yields a new prime when done recursively three times.

Original entry on oeis.org

11, 101, 131, 133, 1013, 2111, 2619, 3173, 3301, 4111, 5907, 8463, 9101, 10033, 10111, 12881, 13833, 14021, 14821, 15443, 16771, 17501, 17831, 18621, 21519, 21567, 28609, 29309, 31133, 31233, 33131, 41621, 42621, 44181, 44421, 44669, 45921, 52707, 55847, 59023
Offset: 1

Views

Author

K. D. Bajpai, Jul 08 2018

Keywords

Examples

			2619 is a term because replacing each digit d by d^2, recursively three times, a prime number is obtained: 2619 -> 436181 (prime); 436181 -> 169361641 (prime); 169361641 -> 13681936136161 (prime).
3173 is a term because replacing each digit d by d^2, recursively three times, a prime number is obtained: 3173 -> 91499 (prime); 91499 -> 811168181 (prime); 811168181 -> 6411136641641 (prime).
		

Crossrefs

Programs

  • Mathematica
    A316604 = {}; Do[ a=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[n]^2)]]; b=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[a]^2)]]; c=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[b]^2)]]; If[PrimeQ[a] && PrimeQ[b] && PrimeQ[c], AppendTo[A316604,n]], {n,100000}]; A316604
  • PARI
    replace_digits(n) = my(d=digits(n), s=""); for(k=1, #d, s=concat(s, d[k]^2)); eval(s)
    is(n) = my(x=n, i=0); while(1, x=replace_digits(x); if(!ispseudoprime(x), return(0), i++); if(i==3, return(1))) \\ Felix Fröhlich, Jul 08 2018

A191867 Numbers n which are both the sum of two nonzero squares and the concatenation of the decimal representation of two nonzero squares.

Original entry on oeis.org

41, 116, 125, 136, 149, 164, 169, 181, 369, 416, 425, 436, 449, 464, 481, 641, 916, 925, 936, 949, 964, 981, 1009, 1225, 1256, 1289, 1361, 1576, 1616, 1625, 1636, 1649, 1664, 1681, 1961, 2516, 2525, 2536, 2549, 2561, 2564, 2581, 3616, 3625, 3636, 3649, 3664
Offset: 1

Views

Author

Raghavendra Ugare, Jun 18 2011

Keywords

Comments

It would be interesting to investigate such numbers w.r.t. higher powers and larger n.

Examples

			The smallest such number is 41, since it is both the sum of two squares (i.e., 4^2, 5^2) and the concatenation of two squares (i.e., 2^2, 1^2).
3649 also belongs to this sequence because it is sum of two squares (i.e., 60^2, 7^2) and the concatenation of two squares (i.e., 6^2, 7^2).
		

Crossrefs

Programs

  • Magma
    z:=65; T:=Sort([ s: a in [b..z], b in [1..z] | s le z^2 where s is a^2+b^2 ]); SplitToSquares:=function(n); V:=[]; S:=Intseq(n); for j in [1..#S-1] do A:=[ S[k]: k in [1..j] ]; a:=Seqint(A); B:=[ S[k]: k in [j+1..#S] ]; b:=Seqint(B); if a gt 0 and A[#A] gt 0 and IsSquare(a) and IsSquare(b) then Append(~V, []); end if; end for; return V; end function; U:=[ p: j in [1..#T] | P ne [] where P is SplitToSquares(p) where p is T[j] ]; [ U[j]: j in [1..#U] | j eq 1 or U[j-1] ne U[j] ]; // Klaus Brockhaus, Jun 19 2011
    
  • Mathematica
    (* find numbers that can be split as the SUM of two powers (squares, cubes, etc.) and also as CONCATENATION of the same powers *)
    siamesePowers[n_, power_] := Module[
    {listOfSumOfPowers, a, b, i, listOfConcatenatedPowers},
    listOfSumOfPowers = Outer[Plus, Table[{i^power}, {i, 1, n}], Table[{i^power}, {i, 1, n}]] // Flatten;
    concatNumbers[a_, b_] := IntegerDigits[{a, b}] // Flatten // FromDigits;
    listOfConcatenatedPowers := Outer[concatNumbers, Table[i^power, {i, 1, n}], Table[i^power, {i, 1, n}]] // Flatten;
    (* The intersection of these 2 lists is the set of our special Siamese numbers *)
    Intersection[listOfSumOfPowers, listOfConcatenatedPowers]
    ]
    siamesePowers[30, 2] (* Generate the first 30 such numbers for squares *)
  • PARI
    is_A191867(n) = for(p=10,n, issquare(n\p) && issquare(n%p) && n%p*10>=p && return(is_A000404(n)); p=p*10-1)  \\ M. F. Hasler, Jun 19 2011

A244558 Numbers obtained by concatenating the squares of the digits of Fibonacci(n).

Original entry on oeis.org

1, 1, 4, 9, 25, 64, 19, 41, 916, 2525, 6481, 11616, 499, 94949, 3610, 816449, 1258149, 4256416, 161641, 36493625, 10811636, 1494911, 464362549, 163693664, 49250425, 1419819, 1813616164, 91496411, 251164481, 64940160, 19163643681, 4149649081, 925416254964
Offset: 1

Views

Author

Vincenzo Librandi, Jul 03 2014

Keywords

Examples

			For n = 7, Fibonacci(7) = 13 and a(7) = 19, which is the concatenation of the squares of the digits of 13. For n = 14, Fibonacci(14) = 377 and a(14) = 94949.
		

Crossrefs

Programs

  • Magma
    [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(Fibonacci(n))])]): n in [1..50]];
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[Fibonacci[n]]^2)]],{n,40}] (* Harvey P. Dale, Jul 31 2018 *)

Formula

a(n) = A048385(A000045(n)).

A296187 Yarborough primes that remain Yarborough primes when each of their digits are replaced by their squares.

Original entry on oeis.org

73, 223, 233, 283, 337, 383, 523, 733, 773, 823, 2333, 2683, 2833, 2857, 3323, 3583, 3673, 3733, 3853, 5333, 6673, 6737, 6883, 7333, 7673, 7727, 7877, 8233, 8563, 8623, 22277, 22283, 22727, 23333, 23833, 25237, 25253, 25633, 26227, 26833, 27583, 27827, 27883, 32257
Offset: 1

Views

Author

K. D. Bajpai, Feb 14 2018

Keywords

Comments

A Yarborough prime is a prime that does not contain digits 0 or 1.
Terms t of A106116 such that A048385(t) is also a term of A106116. - Felix Fröhlich, Feb 14 2018

Examples

			a(1) = 73 is a prime, and replacing each of its digits by its square yields 499, which is also prime. Neither 73 nor 499 contains digits 0 or 1, so both are Yarborough primes.
a(10) = 823 is a prime, and replacing each of its digits by its square gives 6449, another prime. Neither 823 nor 6449 contains digits 0 or 1, so both are Yarborough primes.
		

Crossrefs

Cf. A106116 (Yarborough primes), A048385, A052034, A296563 (digits to cubes).

Programs

  • Mathematica
    k = 2; Select[Prime[Range[1000000]], Min[IntegerDigits[#]] > 1 &&  Min[IntegerDigits[Flatten[IntegerDigits[(IntegerDigits[#]^k)]]]] > 1 && PrimeQ[FromDigits[Flatten[IntegerDigits[(IntegerDigits[#]^k)]]]] &]
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    is_a106116(n) = ispseudoprime(n) && vecmin(digits(n)) > 1
    a048385(n) = my(d=digits(n), e=[]); for(k=1, #d, d[k]=d[k]^2); for(k=1, #d, my(dd=digits(d[k])); for(t=1, #dd, e=concat(e, dd[t]))); eva(e)
    is(n) = is_a106116(n) && is_a106116(a048385(n)) \\ Felix Fröhlich, Mar 26 2018

Formula

{A106116(k): A048385(A106116(k)) in A106116}. - Felix Fröhlich, Feb 14 2018

A316982 Numbers k such that replacing each digit d in the decimal expansion of k with d^3 yields a prime each time, when done recursively three times.

Original entry on oeis.org

11, 31, 101, 173, 1307, 1873, 10111, 11923, 12209, 14767, 20357, 20729, 21149, 22003, 22151, 29261, 43681, 43891, 52033, 52211, 55231, 58121, 65011, 70027, 70399, 80569, 100087, 101111, 101401, 102079, 102113, 120091, 151931, 163669, 172001, 200501, 201113, 203831
Offset: 1

Views

Author

K. D. Bajpai, Jul 18 2018

Keywords

Examples

			173 is a term because replacing each digit d with d^3, recursively three times, a prime number is obtained: 173 -> 134327 (prime); 134327 -> 12764278343 (prime); 12764278343 -> 18343216648343512276427 (prime).
1873 is a term because replacing each digit d with d^3, recursively three times, a prime number is obtained: 1873 -> 151234327 (prime); 151234327 -> 1125182764278343 (prime); 1125182764278343 -> 11812515128343216648343512276427 (prime).
		

Crossrefs

A004022 is a subsequence.

Programs

  • Mathematica
    A316982 = {}; Do[a=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[n]^3)]]; b=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[a]^3)]]; c=FromDigits[Flatten[IntegerDigits /@ (IntegerDigits[b]^3)]]; If[PrimeQ[a] && PrimeQ[b] && PrimeQ[c], AppendTo[A316982, n]], {n,300000}]; A316982 (* or *)
    c[n_] := FromDigits@ Flatten@ IntegerDigits[IntegerDigits[n]^3]; Select[Range[204000], PrimeQ[x = c@#] && PrimeQ[y = c@x] && PrimeQ@c@y &] (* Giovanni Resta, Jul 18 2018 *)
    p3[n_]:=Rest[NestList[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[#]^3)]]&,n,3]]; Select[Range[205000],AllTrue[p3[#],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 11 2019 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    replace_digits(n) = my(d=digits(n), e=[]); for(x=1, #d, my(f=digits(d[x]^3)); if(f==[], e=concat(e, [0]), for(y=1, #f, e=concat(e, f[y])))); eva(e)
    is(n) = my(x=n, i=0); while(i < 3, x=replace_digits(x); if(!ispseudoprime(x), break, i++)); i >= 3 \\ Felix Fröhlich, Oct 24 2018

A386395 Smallest final number reachable from n by successively replacing a substring of digits with its square root.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 7, 8, 3, 10, 11, 12, 13, 12, 15, 2, 17, 18, 13, 20, 21, 22, 23, 22, 5, 26, 27, 28, 23, 30, 31, 32, 33, 32, 35, 6, 37, 38, 33, 20, 21, 22, 23, 22, 5, 26, 27, 28, 7, 50, 51, 52, 53, 52, 55, 56, 57, 58, 53, 60, 61, 62, 63, 8, 65, 66, 67, 68, 63, 70, 71, 72, 73, 72, 75, 76, 77, 78, 73, 80, 3, 82, 83, 82
Offset: 1

Views

Author

Ali Sada, Jul 20 2025

Keywords

Comments

The substring replaced must be a square and cannot begin with a 0 digit.
There may be multiple different replacements possible and the aim is whatever steps reach the smallest final value.

Examples

			425 -> 25 -> 5.
1004 -> 102.
6251 -> 251 -> 51.
9616 -> 3616 -> 196 -> 136 -> 16 -> 4 -> 2.
9996 -> 9936 -> 996 -> 936 -> 96 -> 36 -> 6.
		

Crossrefs

Programs

  • Python
    from math import isqrt
    def children(n):
        s = str(n)
        return set(int(s[:i]+str(r)+s[j:]) for i in range(len(s)) for j in range(i+1, len(s)+1) if (w:=s[i:j])[0]!='0' and (r:=isqrt(t:=int(w)))**2 == t)
    def a(n):
        reach, expand = {n}, [n]
        while expand:
            q = expand.pop()
            for c in children(q):
                if c not in reach:
                    reach.add(c)
                    expand.append(c)
        return min(reach)
    print([a(n) for n in range(1, 85)]) # Michael S. Branicky, Jul 20 2025

A244559 Numbers obtained by concatenating the squares of the digits of n!.

Original entry on oeis.org

1, 4, 36, 416, 140, 4940, 250160, 160940, 936464640, 9364646400, 981811366400, 1649810013600, 3644490406400, 6449149644811400, 1904936491693664000, 408144496481646464000, 925253664491646408136000, 36160494994902549464000, 141361625100160646494000
Offset: 1

Views

Author

Vincenzo Librandi, Jul 03 2014

Keywords

Examples

			For n = 7, 7! = 5040 and a(7) = 250160, which is the concatenation of the squares of the digits of 5040. For n=8, 8! = 40320 and a(8) = 160940.
		

Crossrefs

Programs

  • Magma
    [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(Factorial(n))])]): n in [1..50]];

Formula

a(n) = A048385(A000142(n)). - Michel Marcus, Jul 04 2014

A244746 Numbers obtained by concatenating the squares of the digits of Catalan(n).

Original entry on oeis.org

1, 1, 4, 25, 116, 164, 194, 16481, 11690, 1664364, 136498136, 2564496436, 4064014, 491648100, 436491616160, 81368116641625, 9259254936490, 148136161649810, 164949369644900, 149364943691810, 362536161401640, 41616363643649040, 811166442536936160
Offset: 0

Views

Author

Vincenzo Librandi, Jul 05 2014

Keywords

Examples

			For n = 7, Catalan(7) = 429 and a(7) = 16481, which is the concatenation of the squares of the digits of 429. For n = 14, Catalan(14) = 2674440 and a(14) = 436491616160.
		

Crossrefs

Programs

  • Magma
    [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(Catalan(n))])]): n in [0..30]];
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[ CatalanNumber[ n]]^2)]],{n,0,30}] (* Harvey P. Dale, Sep 23 2020 *)

Formula

a(n) = A048385(A000108(n)).

A244761 Numbers obtained by concatenating the squares of the digits of Lucas(n).

Original entry on oeis.org

4, 1, 9, 16, 49, 11, 164, 481, 1649, 4936, 149, 18181, 944, 2541, 64169, 193616, 44049, 925491, 25494964, 8191681, 1251449, 416164936, 9813609, 361604981, 10936644, 1364949361, 449116169, 169814016, 4910361649, 11168164251, 164360168164, 901091681
Offset: 0

Views

Author

Vincenzo Librandi, Jul 06 2014

Keywords

Crossrefs

Programs

  • Magma
    [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(Lucas(n))])]): n in [0..35]];
    
  • Mathematica
    FromDigits[Flatten[IntegerDigits/@(IntegerDigits[#]^2)]]&/@LucasL[ Range[ 0,40]] (* Harvey P. Dale, Oct 01 2021 *)
  • Python
    from sympy import lucas
    def a(n):  return int("".join(str(int(d)**2) for d in str(lucas(n))))
    print([a(n) for n in range(32)]) # Michael S. Branicky, Apr 01 2021

Formula

a(n) = A048385(A000032(n)). [corrected by Georg Fischer, Dec 19 2020]
Previous Showing 11-19 of 19 results.