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

A019544 Squares whose digits are squares.

Original entry on oeis.org

0, 1, 4, 9, 49, 100, 144, 400, 441, 900, 1444, 4900, 9409, 10000, 10404, 11449, 14400, 19044, 40000, 40401, 44100, 44944, 90000, 144400, 419904, 490000, 491401, 904401, 940900, 994009, 1000000, 1004004, 1014049, 1040400, 1100401, 1144900, 1440000, 1904400
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Are there infinitely many terms not divisible by 100? - Charles R Greathouse IV, Sep 19 2012
Yes. For example, the squares of the type (k*10^m+1)^2, where m>0 and k = 2, 70, 970, 202470000 or m>1 and k = 10^m-3, belong to the sequence. - Bruno Berselli, Jan 10 2013

Crossrefs

Cf. A285550.

Programs

  • Magma
    [n^2: n in [0..2000] | forall{d: d in Intseq(n^2) | d in [0,1,4,9]}]; // Bruno Berselli, Jan 10 2013
  • Maple
    filter:= n -> convert(convert(n,base,10),set) subset {0,1,4,9}:
    select(filter, [seq(n^2,n=0..10^5)]); # Robert Israel, Aug 14 2018
  • Mathematica
    Select[Range[0,1100]^2,SubsetQ[{0, 1, 4, 9}, IntegerDigits[#]] &] (* Stefano Spezia, Nov 28 2024 *)

Formula

a(n) = A285550(n)^2. - Alois P. Heinz, Apr 21 2017

Extensions

Offset changed to 1 by Alois P. Heinz, Apr 21 2017

A316969 Primes p such that p^2 contains all of the square digits {0, 1, 4, 9} only.

Original entry on oeis.org

701, 7001, 10007, 10243, 20347, 70001, 97001, 202757, 306749, 379499, 700001, 997001, 1002247, 1070021, 3317257, 3346507, 9536249, 9970001, 10095247, 20470501, 21095021, 22144979, 94925771, 100000007, 100099501, 104933743, 202520347, 300191597
Offset: 1

Views

Author

K. D. Bajpai, Jul 17 2018

Keywords

Comments

Subset of A285550.

Examples

			701^2 = 491401 that contains all the square digits {0, 1, 4, 9} only. Hence, 701 is a term.
10243^2 = 104919049 that contains all of the square digits {0, 1, 4, 9} only. Hence, 10243 is a term.
997 is not a term because 997^2 = 994009 does not contain the digit '1'.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[20000000]], Union[IntegerDigits[#^2]] == {0, 1, 4, 9} &]

A308917 Primes p such that the digits of p^2 are squares.

Original entry on oeis.org

2, 3, 7, 97, 107, 701, 997, 1049, 7001, 10007, 10243, 20347, 70001, 97001, 100549, 202757, 306749, 379499, 700001, 997001, 1002247, 1070021, 3317257, 3346507, 9536249, 9970001, 10095247, 20470501, 21095021, 22144979, 94925771, 100000007, 100099501, 104933743, 202520347
Offset: 1

Views

Author

Bernard Schott, Jun 30 2019

Keywords

Comments

The prime numbers of the form p = 7 * 10^k + 1 with k > = 2 are terms of the sequence. For example, for k = 2, 3, 4, 5, 8, 9, 45, 136, 142, 158, 243, 923, .... The squares have the form p^2 = 49 * 10^(2*k) + 14 * 10^k + 1 and the digits 0, 1, 4 and 9. - Marius A. Burtea, Jul 01 2019
Same remark with primes of the form p = 10^k + 7 and k > = 2 that are also terms of this sequence. For example, for k = 2, 4, 8, 9, ... The squares have the form p^2 = 100^k + 14 * 10^k + 49, so with only the digits 0, 1, 4 and 9. These primes are in A159031 \ {17}. - Bernard Schott, Jul 01 2019
From Chai Wah Wu, Jul 03 2019: (Start)
The prime numbers of the form p = (10^m-3)*10^k + 1 with k > m > 0 are terms of this sequence. Note that this includes primes of the form 7 * 10^k + 1 with k >=2 described in the first comment above. The squares are of the form p^2 = (10^m-3)^2*10^(2*k) + 2(10^m-3)*10^k + 1. Note that (10^m-3)^2 = 10^m(10^m-6)+9 which only contains the digits 0, 4 and 9. Similarly, 2*(10^m-3) = 2*10^m-6 which only contains the digits 1, 9 and 4 and has m+1 <= k decimal digits. Thus p^2 only contains the digits 0, 1, 4, 9. Some examples include (m,k) = (2,3), (2,8), (2,15), (3,4), (3,18), (4,71), (5,20), (6,7), ...
A similar argument shows that prime numbers of the form p = 10^k + (10^m-3) for k >= 2*m > 0 (which includes the primes of the form 10^k+7) are also terms of this sequence. In this case some examples include (m,k) = (2,9), (2,10), (3,12), (3,18), (4,10), (4,11), (5,14), ...
Some other sets of terms are:
1. primes of the form p = 20247*10^k+1 for k >= 5. Examples include k = 7, 25, 29, 31, ...
2. primes of the form p = 10^k + 20247 for k >= 9. Examples include k = 11, 15, 18, 19, 20, ...
3. primes of the form p = 2224745247*10^k+1 for k >= 10. Examples include k = 31, 57, 115, 163, ...
4. primes of the form p = 10^k + 2224745247 for k >= 19. Examples include k = 87, 257, 645, 819, ...
(End)

Examples

			997 is a term because 997 is prime and 997^2 = 994009 with 0, 4, 9 that are all squares.
		

Crossrefs

Cf. subsequences: A159031, A316969.
Intersection of A000040 and A285550.

Programs

  • MATLAB
    p=primes(10000000); m=1;
    for u=1:length(p) digit=dec2base(p(u).^2,10)-'0';
        if (mod(sqrt(digit), 1) == 0) sol(m)=p(u); m=m+1; end
    end
    sol % Marius A. Burtea, Jun 30 2019
    
  • Mathematica
    ok[n_] := AllTrue[IntegerDigits[n], MemberQ[{0, 1, 4, 9}, #] &]; mo = Select[Range[1, 10^6, 2], ok@Mod[#^2, 10^6] &]; Reap[Sow@2; Do[x = 10^6 t + m; If[PrimeQ[x] && ok[x^2], Sow[x]], {t, 0, 202}, {m, mo}]][[2, 1]] (* Giovanni Resta, Jul 02 2019 *)
    Select[Prime[Range[11211000]],AllTrue[Sqrt[IntegerDigits[#^2]],IntegerQ]&] (* Harvey P. Dale, Aug 17 2021 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p^2)) && (#select(x->issquare(x), d) == #d); \\ Michel Marcus, Jun 30 2019

Extensions

More terms from Michel Marcus, Jun 30 2019

A317579 Integers n such that the digit set of n^2 is {0,1,4,9}.

Original entry on oeis.org

138, 648, 701, 951, 1007, 1070, 1380, 1393, 3153, 3451, 3743, 3747, 4462, 6357, 6480, 7001, 7010, 7071, 9510, 9701, 10007, 10070, 10097, 10243, 10538, 10700, 13800, 13930, 20247, 20347, 22138, 31530, 34510, 37430, 37470, 37538, 38071, 38602, 44620, 63357, 63403, 63570, 64800
Offset: 1

Views

Author

Robert G. Wilson v, Jul 31 2018

Keywords

Comments

n cannot end in the decimal digits 4, 5 or 6; but it most often ends in 0 since if n is present so is 10*n.
n cannot start with the decimal digits 5 or 8. It usually starts with either 3 or 1.
n must lie between 1*10^k & sqrt(2)*10^k, 2*10^k & sqrt(5)*10^k, 3 & sqrt(12)*10^k, sqrt(14)*10^k & sqrt(15)*10^k, sqrt(19)*10^k & sqrt(20)*10^k, sqrt(40)*10^k & sqrt(45)*10^k, sqrt(49)*10^k & sqrt(50)*10^k, sqrt(90)*10^k & sqrt(92)*10^k, sqrt(94)*10^k & sqrt(95)*10^k, sqrt(99)*10^k & sqrt(100)*10^k; for k>0.

Examples

			138 = 19044 which has only the decimal digits 0, 1, 4 & 9. Therefore it is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Union[IntegerDigits[n^2]] == {0, 1, 4, 9}; Select[ Range@ 65000, fQ]
  • PARI
    isok(n) = Set(digits(n^2)) == [0, 1, 4, 9]; \\ Michel Marcus, Aug 01 2018
Showing 1-4 of 4 results.