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.

A308961 Numbers k not divisible by 10 such that k^2 and 2*k are in A046030.

Original entry on oeis.org

2, 7, 97, 997, 9997, 20247, 99997, 999997, 9999997, 99999997, 999999997, 2224745247, 9999999997, 99999999997, 999999999997, 9999999999997, 99999999999997, 999999999999997, 9999999999999997, 99999999999999997
Offset: 1

Views

Author

Chai Wah Wu, Jul 04 2019

Keywords

Comments

10^j - 3 are terms. Most of the terms so far are of the form 10^j - 3. Are there other terms not of this form besides 2, 20247, and 2224745247?
If k is a term, then primes of the form k*10^j + 1 for j >= A055642(2*k) are in A308917 and primes of the form 10^j + k for j >= A055642(k^2) are in A308917.

Crossrefs

Extensions

Edited by Max Alekseyev, Jul 13 2019

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

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

A244283 Consider a number n with m decimal digits, m>9. The sequence lists the numbers n such that the prefix of length m-1 and the suffix of length m-1 are both perfect squares.

Original entry on oeis.org

10, 11, 14, 19, 40, 41, 44, 49, 90, 91, 94, 99, 164, 364, 649, 816, 1000, 1001, 1004, 1009, 1441, 1961, 2256, 4000, 4001, 4004, 4009, 4841, 6256, 7841, 9000, 9001, 9004, 9009, 20256, 30256, 31369, 40961, 46241, 51849, 54761, 60841, 73969, 79216, 90256, 94096
Offset: 1

Views

Author

Michel Lagneau, Jun 25 2014

Keywords

Comments

Let x(0)x(1)... x(q-1)x(q) denote the decimal expansion of a number n. The sequence lists the numbers n such that the prefix x(0)x(1)... x(q-1) and the suffix x(1)... x(q-1)x(q) are both a perfect square.
The primes of the sequence are 11, 19, 41, 1009, 4001, 7841, 9001, 40961,...

Examples

			816 is in the sequence because 81 and 16 are squares.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 10 to 20000 do:
          x:=convert(n, base, 10):n1:=nops(x):
          s1:=sum('x[i]*10^(i-1) ', 'i'=1..n1-1):
          s2:=(n-irem(n,10))/10:ss1:=sqrt(s1):ss2:=sqrt(s2):
          if ss1=floor(ss1) and ss2=floor(ss2)
          then
            printf(`%d, `, n):
            else
          fi:
    od:
  • PARI
    isok(n) = (left = n\10) && issquare(left) && (pt = 10^(#Str(n)-1)) && issquare(n - (n\pt)*pt); \\ Michel Marcus, Jun 25 2014

A036435 Digits are nonzero squares.

Original entry on oeis.org

1, 4, 9, 11, 14, 19, 41, 44, 49, 91, 94, 99, 111, 114, 119, 141, 144, 149, 191, 194, 199, 411, 414, 419, 441, 444, 449, 491, 494, 499, 911, 914, 919, 941, 944, 949, 991, 994, 999, 1111, 1114, 1119, 1141, 1144, 1149, 1191, 1194, 1199, 1411, 1414, 1419, 1441
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk)

Keywords

Comments

Invented by the HR concept formation program.

Crossrefs

Cf. A046030.

Programs

  • Mathematica
    Flatten[Table[FromDigits/@Tuples[{1,4,9},n],{n,4}]] (* Harvey P. Dale, May 18 2015 *)
  • PARI
    isok(n) = {digs = digits(n); for (i=1, #digs, if (! digs[i] || ! issquare(digs[i]), return (0));); return (1);} \\ Michel Marcus, Aug 31 2013

Extensions

More terms from Sam Alexander (pink2001x(AT)hotmail.com).

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

A261713 Natural numbers that can be split into two squares, leading zeros allowed.

Original entry on oeis.org

10, 11, 14, 19, 40, 41, 44, 49, 90, 91, 94, 99, 100, 101, 104, 109, 116, 125, 136, 149, 160, 161, 164, 169, 181, 250, 251, 254, 259, 360, 361, 364, 369, 400, 401, 404, 409, 416, 425, 436, 449, 464, 481, 490, 491, 494, 499, 640, 641, 644, 649, 810, 811, 814
Offset: 1

Views

Author

Giovanni Teofilatto, Aug 29 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local d, i, k;
          for k from 1+`if`(n=1, 1, a(n-1))
          do for i to length(k)-1 do
               if issqr(iquo(k, 10^i, 'd')) and
                  issqr(d) then return k fi
             od
          od
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Aug 29 2015
  • Mathematica
    qQ[n_] := Floor[ Sqrt@ n]^2 == n; ok[n_] := Catch[ Do[ If[ qQ@ Floor[n / 10^k] && qQ@ Mod[n, 10^k],Throw@ True], {k, IntegerLength[n] -1}]; False]; Select[Range@ 1000, ok] (* Giovanni Resta, Aug 29 2015 *)

Extensions

Name clarified by Zak Seidov, Aug 29 2015

A384436 a(n) is the number of distinct ways to represent n in any integer base >= 2 using only square digits.

Original entry on oeis.org

1, 1, 1, 2, 4, 3, 3, 3, 3, 6, 5, 4, 5, 5, 4, 4, 6, 5, 4, 5, 7, 7, 5, 5, 7, 8, 6, 6, 8, 7, 7, 7, 7, 7, 7, 6, 11, 9, 6, 7, 10, 7, 7, 7, 8, 8, 8, 6, 8, 11, 7, 7, 9, 10, 7, 7, 10, 10, 7, 7, 11, 10, 7, 7, 13, 11, 7, 7, 11, 10, 7, 7, 10, 11, 8, 8, 11, 11, 9, 8, 11, 15
Offset: 0

Views

Author

Felix Huber, May 29 2025

Keywords

Comments

The representations of n remain the same for bases greater than n, as they all consist solely of the digit n.

Examples

			The a(36) = 11 distinct ways to represent 36 using only square digits are [1,0,0,1,0,0] in base 2, [1,1,0,0] in base 3, [1,0,0] in base 6, [4,4] in base 8, [4,0] in base 9, [1,16] in base 20, [1,9] in base 27, [1,4] in base 32, [1,1] in base 35, [1,0] in base 36 and [36] in bases >= 37.
		

Crossrefs

Programs

  • Maple
    A384436:=proc(n)
        local a,b,c;
        a:=0;
        for b from 2 to n+1 do
            c:=convert(n,'base',b);
            if select(issqr,c)=c then
                a:=a+1
            fi
        od;
        return max(1,a)
    end proc;
    seq(A384436(n),n=0..81);
  • Mathematica
    a[n_] := Sum[Boole[AllTrue[IntegerDigits[n, b], IntegerQ[Sqrt[#]] &]], {b, 2, n+1}]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, May 29 2025 *)
  • PARI
    a(n) = sum(b=2, n+1, my(d=digits(n,b)); #select(issquare, d) == #d); \\ Michel Marcus, May 29 2025

Formula

Trivial lower bound for n >= 2: a(n) >= 2 for nonsquares n and a(n) >= 3 for squares n because in base 2 the representations of n consists only of the square digits '0' and '1', in base n the representation of n is [1,0] and in bases > n the representation of n is [n].
Showing 1-9 of 9 results.