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

A048389 Primes resulting from procedure described in A048388.

Original entry on oeis.org

11, 19, 149, 181, 41, 449, 251, 2549, 491, 499, 641, 6449, 6481, 811, 101, 109, 1049, 1181, 149, 1481, 191, 199, 1949, 11681, 1259, 1361, 13649, 13681, 1499, 16481, 1811, 18149, 18181, 401, 409, 4049, 419, 449, 4481, 491, 499, 41681, 4259, 43649
Offset: 1

Views

Author

Patrick De Geest, Mar 15 1999

Keywords

Comments

Primes in A048385 in order of their occurrence. - Andrew Howroyd, Aug 15 2024

Crossrefs

Formula

a(n) = A048385(A048388(n)). - Andrew Howroyd, Aug 15 2024

Extensions

Offset corrected by Andrew Howroyd, Aug 15 2024

A048385 In base-10 notation replace digits of n with their squared values (Version 1).

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 10, 11, 14, 19, 116, 125, 136, 149, 164, 181, 40, 41, 44, 49, 416, 425, 436, 449, 464, 481, 90, 91, 94, 99, 916, 925, 936, 949, 964, 981, 160, 161, 164, 169, 1616, 1625, 1636, 1649, 1664, 1681, 250, 251, 254, 259, 2516, 2525
Offset: 0

Views

Author

Patrick De Geest, Mar 15 1999

Keywords

Crossrefs

See A068522 for another version.

Programs

  • Haskell
    a048385 0 = 0
    a048385 n = read (show (a048385 n') ++ show (m ^ 2)) :: Integer
                where (n', m) = divMod n 10
    -- Reinhard Zumkeller, Jul 08 2014
    
  • MATLAB
    m=1;
    for u=0:200 digit=dec2base(u,10)-'0'; digitp=digit.^2;
        sol(m)=str2num(strrep(num2str(digitp), ' ', ''));m=m+1;
    end
    sol % Marius A. Burtea, May 17 2019
  • Magma
    [0] cat [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(n)])]): n in [1..55]]; // Bruno Berselli, Jul 31 2012
    
  • Maple
    a:= n-> (s-> parse(cat(seq(parse(s[i])^2, i=1..length(s)))))(""||n):
    seq(a(n), n=0..70);  # Alois P. Heinz, Jul 04 2014
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[n]^2)]],{n,0,80}] (* Harvey P. Dale, May 06 2019 *)
  • PARI
    a(n) = if (n, fromdigits(concat(apply(d -> my (d2=d^2); if (d2, digits(d2), [0]), digits(n)))), 0) \\ Rémy Sigrist, May 17 2019
    
  • Python
    def digits(n):
        d=[]
        while n>0:
            d.append(n%10)
            n=n//10
        return d
    def sqdig(n):
        new=0
        num=digits(n)
        spacing=0
        while num:
            k=num.pop(0)
            new+=(10**(spacing))*(k**2)
            if k>3:
                spacing+=1
            spacing+=1
        return new
    # David Nacin, Aug 19 2012
    

Formula

a(n) >= n with equality iff n belongs to A007088. - Rémy Sigrist, May 17 2019

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
Showing 1-3 of 3 results.