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.

A366106 Primes that are the concatenation of three squares in base 10.

Original entry on oeis.org

101, 109, 149, 191, 199, 401, 409, 419, 449, 491, 499, 911, 919, 941, 991, 1049, 1181, 1259, 1361, 1481, 1499, 1601, 1609, 1619, 1699, 1811, 1949, 2549, 2591, 3691, 4049, 4259, 4481, 4649, 4909, 4919, 4999, 6449, 6491, 8101, 8111, 8191, 9049, 9161, 9181, 9491, 9649, 9811, 9949, 10009, 10091
Offset: 1

Views

Author

Robert Israel, Sep 29 2023

Keywords

Comments

The three squares need not be distinct.
At least one of the squares must be divisible by 9.
The first term that is a concatenation of three squares in two different ways is 14411, the concatenation of 1 = 1^2, 441 = 21^2 and 1 = 1^2 and also 144 = 12^2, 1 = 1^2 and 1 = 1^2.
The first term that is a concatenation of three squares in three different ways is 1961441, the concatenation of 196 = 14^2, 144 = 12^2 and 1 = 1^2, of 196, 1 and 441 = 21^2, and of 1, 961 = 31^2 and 441.

Examples

			a(16) = 1049 is a term because it is the concatenation of 1 = 1^2, 0 = 0^2 and 49 = 7^2.
		

Crossrefs

Cf. A167535.

Programs

  • Maple
    M:= 5: # for terms < 10^M
    S:= {}:
    for a from 1 while a^2 < 10^(M-2) do
      x:= a^2; mx:= length(x);
      for b from 0 while b^2 < 10^(M-1-mx) do
        y:= b^2; my:= max(1,length(y));
        for c from 0 while c^2 < 10^(M-mx-my) do
          v:= parse(cat(x,y,c^2));
          if isprime(v) then S:= S union {v} fi;
    od od od:
    sort(convert(S,list));
  • Mathematica
    a[maxSquareIndex_Integer?Positive]:=Select[Flatten[Table[ToExpression[IntegerString[a^2]<>IntegerString[b^2]<>IntegerString[c^2]],{a,1,maxSquareIndex},{b,0,maxSquareIndex},{c,0,maxSquareIndex}]],PrimeQ]//Sort;a[10][[1;;51]] (* Robert P. P. McKone, Oct 02 2023 *)