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

A006716 Squares with digits 1, 4, 9.

Original entry on oeis.org

1, 4, 9, 49, 144, 441, 1444, 11449, 44944, 991494144, 4914991449, 149991994944, 9141411499911441, 199499144494999441, 9914419419914449449, 444411911999914911441, 419994999149149944149149944191494441
Offset: 1

Views

Author

N. J. A. Sloane, revised Jul 10 2015

Keywords

Comments

This is probably a finite sequence, but that is only a conjecture.
Since 1, 4 and 9 are squares, all terms are in A053059. - Rabii Younès, Mar 17 2025

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 234.

Crossrefs

Subsequence of A019544 and A053059.
Cf. A027675 (square roots), A061269.
For other digit groups {0,1,2} through {7,8,9}, see also: A058411, ..., A058472, A058473, A058474.

Formula

a(n) = A027675(n)^2. - M. F. Hasler, Nov 15 2017

Extensions

a(13) corrected by Neven Juric (neven.juric(AT)apis-it.hr), May 14 2003

A285550 Numbers k such that the digits of k^2 are squares.

Original entry on oeis.org

0, 1, 2, 3, 7, 10, 12, 20, 21, 30, 38, 70, 97, 100, 102, 107, 120, 138, 200, 201, 210, 212, 300, 380, 648, 700, 701, 951, 970, 997, 1000, 1002, 1007, 1020, 1049, 1070, 1200, 1380, 1393, 2000, 2001, 2010, 2100, 2120, 3000, 3148, 3153, 3451, 3743, 3747, 3800, 4462
Offset: 1

Views

Author

Colin Barker, Apr 21 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Sqrt[#]&/@Select[Range[0,3800]^2,SubsetQ[{0,1,4,9},IntegerDigits[#]]&] (* Harvey P. Dale, Jun 14 2022 *)
  • PARI
    maxk=10000; L=List(); for(k=0, maxk, if(setminus(vecsort(digits(k^2),,8), [0,1,4,9]) == [], listput(L, k))); Vec(L)

Formula

a(n) = sqrt(A019544(n)). - Alois P. Heinz, Apr 21 2017

A030288 a(n+1) is smallest square > a(n) having no digits in common with a(n), with a(0) = 0.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 81, 225, 361, 400, 529, 676, 841, 900, 1156, 2209, 3136, 4225, 6889, 7225, 8100, 24336, 58081, 69696, 70225, 84681, 90000, 111556, 200704, 316969, 407044, 511225, 608400, 923521, 4000000, 5112121, 6036849
Offset: 0

Views

Author

Keywords

Comments

It appears that from a(102) on, there is a 4-periodic pattern: a(4k) ~ 3*10^(k-3) a(4k+1) ~ 6.1111...*10^(k-3), a(4k+2) ~ 7*10^(k-3), a(4k+3) ~ 8.1111...*10^(k-3), where ~ means the next larger square which has only digits {0, 3, 4, 5, 7} for even-indexed terms, or {1, 2, 6, 8, 9} for odd-indexed terms. - M. F. Hasler, Nov 12 2017

Crossrefs

Programs

  • Mathematica
    FromDigits /@ NestList[Block[{k = Sqrt@ FromDigits@ # + 1, m}, While[ContainsAny[#, Set[m, IntegerDigits[k^2]]], k++]; m] &, {0}, 38] (* Michael De Vlieger, Nov 02 2017 *)
    ssga[a_]:=Module[{k=Floor[Sqrt[a]]+1},While[Length[Intersection[IntegerDigits[k^2],IntegerDigits[ a]]]> 0,k++];k^2]; NestList[ssga,0,40] (* Harvey P. Dale, Sep 10 2024 *)
  • PARI
    next_A030288(n, D(n)=Set(digits(n)), S=D(n))={for(k=sqrtint(n)+1, oo, #setintersect(D(k^2), S)||return(k^2))} \\ Could be made more efficient by implementing the observed patterns, in particular for n >= 104. - M. F. Hasler, Nov 12 2017

Formula

a(n) = A030287(n)^2. - Michel Marcus, Nov 03 2017

A077437 Squares whose decimal digits are nonsquares (2, 3, 5, 6, 7, 8).

Original entry on oeis.org

25, 36, 225, 256, 576, 625, 676, 5625, 5776, 7225, 8836, 27225, 27556, 33856, 37636, 55225, 65536, 75625, 225625, 226576, 235225, 265225, 266256, 275625, 276676, 286225, 352836, 367236, 378225, 525625, 538756, 553536, 585225, 586756, 665856
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 06 2002

Keywords

Crossrefs

Cf. A019544, A000290. Different from A077676.

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{2,3,5,6,7,8},n],IntegerQ[ Sqrt[ #]]&],{n,2,6}]] (* Harvey P. Dale, Feb 05 2014 *)
  • PARI
    is(n)=issquare(n) && #setintersect(Set(digits(n)),[0,1,4,9])==0 \\ Charles R Greathouse IV, Aug 28 2016

Extensions

Replaced 9 by 8 in the definition. - Tanya Khovanova, Dec 09 2008

A077439 Numbers k such that k and k^2 have square decimal digits.

Original entry on oeis.org

0, 1, 10, 100, 1000, 1049, 10000, 10490, 100000, 100499, 104900, 1000000, 1004990, 1049000, 10000000, 10004999, 10049900, 10490000, 100000000, 100049990, 100499000, 104900000, 1000000000, 1000049999, 1000499900, 1004990000, 1044049999, 1049000000, 10000000000, 10000499990, 10004999000, 10049900000, 10440499990
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 06 2002

Keywords

Comments

Numbers k such that k and the square of k use only the digits 0, 1, 4 and 9.
Notice the trick used in the first Mathematica program to convert decimal numbers to base-4 numbers and then map threes into nines and then twos into fours. This saves a lot of computing. - Robert G. Wilson v, Nov 08 2002
From Robert Israel, Dec 18 2023: (Start)
If k is a term, then so is 10 * k.
Terms that do not end in 0 include
10^(2*j+1) + 5*10^j - 1 for j >= 1, and
10^(2*j+1) + 5*10^(2*j-i) - 10^(2*j-2*i) + 5*10^j - 1 for i >= 1 and j >= 4*i + 3. (End)

Examples

			1049^2 = 1100401, therefore 1049 is a term.
A046030(7)=14 is not a term, as 14^2=196 and 6 is not a square digit.
104900499999000^2 = 11004114900040199000001000000.
		

Crossrefs

A077440(n) = a(n)^2.

Programs

  • Maple
    M:= 15: # for terms of up to M digits
    f:= proc(n,d) n >= 10^(d-1) and convert(convert(n^2,base,10),set) subset {0,1,4,9} end proc:
    g:= proc(n,d) convert(convert(n^2 mod 10^d,base,10),set) subset {0,1,4,9} end proc:
    R:= 0, 1:
    C:= [0,1,9]:
    for d from 2 to M do
      C:= select(g,map(t -> (t, t+10^(d-1), t+4*10^(d-1), t+9*10^(d-1)), C),d);
      V:= select(f, C,d);
      R:= R, op(V);
    od:
    sort([R]); # Robert Israel, Dec 18 2023
  • Mathematica
    a = {}; Do[d = FromDigits[ ReplaceAll[ IntegerDigits[n, 4], {3 -> 9, 2 -> 4}]]; If[ Union[ Join[ IntegerDigits[d^2], {0, 1, 4, 9}]] == {0, 1, 4, 9}, a = Append[a, d]], {n, 0, 3*10^5}]; a
    With[{c={0,1,4,9}},Select[FromDigits/@Tuples[c,11],SubsetQ[c, IntegerDigits[ #^2]]&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 15 2017 *)
  • PARI
    See PARI link
  • Python
    from itertools import count, islice
    def A077429_gen(): # generator of terms
        for m in count(0):
            s = bin(m)[2:]
            if len(s)&1: s='0'+s
            n = int(''.join({'00':'0','01':'1','10':'4','11':'9'}[s[i:i+2]] for i in range(0,len(s),2)))
            if set(str(n**2)) <= {'0','1','4','9'}:
                yield n
    A077429_list = list(islice(A077429_gen(),20)) # Chai Wah Wu, Dec 19 2023
    

Extensions

Edited by Robert G. Wilson v, Nov 08 2002
More terms from Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
Edited by N. J. A. Sloane, May 15 2008 at the suggestion of R. J. Mathar

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} &]

A077440 Squares and their roots having square decimal digits.

Original entry on oeis.org

0, 1, 100, 10000, 1000000, 1100401, 100000000, 110040100, 10000000000, 10100049001, 11004010000, 1000000000000, 1010004900100, 1100401000000, 100000000000000, 100100004990001, 101000490010000, 110040100000000
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 06 2002

Keywords

Comments

If k is a term, then so is 100 * k. - Robert Israel, Aug 26 2024

Examples

			a(6) = 1100401 = 1049^2.
A019544(8)=441 is not a term, as 441=21^2 and 2 is not a square digit.
		

Crossrefs

a(n) = A077439(n)^2.

Programs

  • Maple
    N:= 30: # for terms of up to 2*N digits
    R:= {1}: T:= {1,9}:
    for d from 2 to N do
      T:= select(t -> convert(convert(t^2 mod 10^d, base,10),set) subset {0,1,4,9}, map(t -> (t, t + 10^(d-1), t + 4*10^(d-1), t + 9*10^(d-1)), T));
      R:= R union select(t -> convert(convert(t^2,base,10),set) subset {0,1,4,9},T);
    od:
    R2:= map(t -> t^2, R):
    Res:= map(t -> seq(t*10^(2*i), i=0..(2*N-ilog10(t)-1)/2), R2) union {0}:
    sort(convert(Res,list)); # Robert Israel, Aug 26 2024
  • Mathematica
    a = {}; Do[d = FromDigits[ ReplaceAll[ IntegerDigits[n, 4], {3 -> 9, 2 -> 4}]]; If[ Union[ Join[ IntegerDigits[d^2], {0, 1, 4, 9}]] == {0, 1, 4, 9}, a = Append[a, d^2]], {n, 0, 3*10^4}]; a

Extensions

Edited by Robert G. Wilson v, Nov 08 2002

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

A350382 a(n) = 9 + 4 * 10^n.

Original entry on oeis.org

49, 409, 4009, 40009, 400009, 4000009, 40000009, 400000009, 4000000009, 40000000009, 400000000009, 4000000000009, 40000000000009, 400000000000009, 4000000000000009, 40000000000000009, 400000000000000009, 4000000000000000009, 40000000000000000009, 400000000000000000009, 4000000000000000000009
Offset: 1

Views

Author

Bernard Schott, Dec 28 2021

Keywords

Comments

The 4th problem of 16th Tournament of Towns in 1994-1995, Spring tour 1995, 8-9 grades, Training option, asked for a proof that the number 400...009 with at least one zero is not a perfect square (see link).
Indeed, the first few squares whose digits are 0, 4 and 9 are 4900, 9409, 490000, 940900, 994009, ... (comes from A019544).
Generalization: the 4th problem of 16th Tournament of Towns in 1994-1995, Spring tour 1995, 10-11 grades, Training option, asked for a proof that the number d00...009 with at least one zero is not a perfect square, when d is a digit with 1 <= d <= 9 (see link).

Examples

			a(3) = 9 + 4 * 10^3 = 4009 = 19 * 211 is not a square.
		

References

  • Steve Dinh, The Hard Mathematical Olympiad Problems And Their Solutions, AuthorHouse, 2011, Problem 1 (in fact, it is Problem 4) of Tournament of Towns 1995, page 301.

Crossrefs

Programs

  • Maple
    Data := [seq(9 + 4*10^n,  n = 1..20)];
  • Mathematica
    a[n_] := 9 + 4*10^n; Array[a, 20] (* Amiram Eldar, Dec 28 2021 *)

Formula

a(n) = 9 + 4*10^n = 4*A133384(n-1) + 1.
a(n) = 24*A126109(n-1) + 1 = 10*A199684(n-1) - 1. - Hugo Pfoertner, Dec 28 2021
From Stefano Spezia, Dec 28 2021: (Start)
G.f.: x*(49 - 130*x)/((1 - x)*(1 - 10*x)).
a(n) = 11*a(n-1) - 10*a(n-2) for n > 2. (End)
Showing 1-9 of 9 results.