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.

A104301 Primes which are the reverse concatenation of two consecutive square numbers.

Original entry on oeis.org

41, 6449, 196169, 576529, 11561089, 14441369, 27042601, 38443721, 51845041, 60845929, 67246561, 84648281, 1081610609, 2073620449, 2190421609, 2822427889, 3240032041, 4000039601, 4326442849, 5017649729, 5290052441, 6250062001, 7507674529, 8294482369, 103684103041
Offset: 1

Views

Author

Shyam Sunder Gupta, Apr 17 2005

Keywords

Examples

			The first term is 41 which is a prime and is the reverse concatenation of 1 and 4 which are two consecutive square numbers.
		

Crossrefs

These are the primes in A246972.

Programs

  • Mathematica
    cat[s_] := FromDigits[Flatten[IntegerDigits[s]]]; Select[cat /@ Reverse /@ Partition[Range[350]^2, 2, 1], PrimeQ] (* Amiram Eldar, Jul 15 2025 *)
  • Python
    from sympy import isprime
    A104301_list = []
    for n in range(1, 2000):
        x = int(str((n+1)**2)+str(n**2))
        if isprime(x):
            A104301_list.append(x) # Chai Wah Wu, Sep 13 2014

A246973 n^2 concatenated with (n+1)^2.

Original entry on oeis.org

1, 14, 49, 916, 1625, 2536, 3649, 4964, 6481, 81100, 100121, 121144, 144169, 169196, 196225, 225256, 256289, 289324, 324361, 361400, 400441, 441484, 484529, 529576, 576625, 625676, 676729, 729784, 784841, 841900, 900961, 9611024, 10241089, 10891156, 11561225, 12251296, 12961369, 13691444
Offset: 0

Views

Author

N. J. A. Sloane, Sep 13 2014

Keywords

Examples

			a(2) = 49 because 2^2 = 4 and 3^2 = 9.
a(3) = 916 because 3^2 = 9 and 4^2 = 16.
a(4) = 1625 because 4^2 = 16 and 5^2 = 25.
		

Crossrefs

For primes see A104242.
Cf. A235497.

Programs

  • Magma
    [1] cat [Seqint(Intseq(n^2+2*n+1) cat Intseq(n^2)): n in [1..50]]; // Vincenzo Librandi, Sep 13 2014
    
  • Maple
    a:= n-> parse(cat(n^2, (n+1)^2)):
    seq(a(n), n=0..40);  # Alois P. Heinz, May 27 2018
  • Mathematica
    Table[FromDigits[Join[IntegerDigits[n^2], IntegerDigits[(n + 1)^2]]], {n, 0, 39}] (* Alonso del Arte, Sep 13 2014 *)
  • PARI
    a(n) = eval(Str(n^2,(n+1)^2)) \\ Michel Marcus, Sep 13 2014 and M. F. Hasler, May 27 2018
    
  • PARI
    A246973(n)=n^2*10^logint(10*(n+1)^2,10)+(n+1)^2 \\ Over 4 x faster than using eval(Str(...)). - M. F. Hasler, May 27 2018

A090738 Integers n such that the concatenation of n^2 and (n+1)^2 is prime.

Original entry on oeis.org

8, 12, 18, 20, 28, 40, 48, 82, 88, 92, 96, 98, 112, 128, 132, 140, 142, 218, 232, 238, 240, 246, 252, 272, 286, 288, 330, 332, 346, 356, 360, 376, 380, 450, 458, 460, 462, 466, 488, 500, 518, 532, 538, 550, 588, 590, 596, 602, 610, 612, 616, 630, 640, 646, 648
Offset: 1

Views

Author

Alex Kontorovich (alexk(AT)math.columbia.edu), Jan 19 2004

Keywords

Comments

I conjecture this sequence to be infinite. Searching through the first 200000 values, I found 7000 primes, of which over 400 were "twins", i.e. both n^2*(n+1)^2 and (n+2)^2*(n+3)^2 were prime, where "*" denotes concatenation. I conjecture there to be an infinitude of such twins and the obvious generalizations.
The symmetric problem, i.e., finding two consecutive primes whose concatenation is a square, is somehow harder. Probably the smallest such primes are p = 411828016678198512725064549221 and its successor p+20, whose concatenation is equal to 641738277398347583345401533579^2. - Giovanni Resta, Jul 23 2015

Examples

			The first term, n=8 corresponds to the prime 6481, which is the concatenation of 8^2=64 and 9^2=81. The second term, n=12 corresponds to the prime 144169.
		

Crossrefs

See A104242 for the corresponding primes.

Programs

  • Mathematica
    For[i=1, i<200000, i=i+1, n=2i;e=IntegerPart[2 Log[10, n+1]]+1;x=10^e n^2 + (n+1)^2;y={n, x}; If[ PrimeQ[x], Save["primes.txt", y]]]
    Select[Range@ 648, PrimeQ@ FromDigits[IntegerDigits[#^2] ~Join~ IntegerDigits[(# + 1)^2]] &] (* Michael De Vlieger, Jul 23 2015 *)
    Position[FromDigits[Flatten[IntegerDigits/@#]]&/@Partition[ Range[ 700]^2, 2,1],?PrimeQ]//Flatten (* _Harvey P. Dale, Dec 23 2018 *)
Showing 1-3 of 3 results.