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-10 of 11 results. Next

A156977 Numbers n such that n^2 contains every decimal digit exactly once.

Original entry on oeis.org

32043, 32286, 33144, 35172, 35337, 35757, 35853, 37176, 37905, 38772, 39147, 39336, 40545, 42744, 43902, 44016, 45567, 45624, 46587, 48852, 49314, 49353, 50706, 53976, 54918, 55446, 55524, 55581, 55626, 56532, 57321, 58413, 58455, 58554, 59403, 60984
Offset: 1

Views

Author

Zak Seidov, Feb 20 2009

Keywords

Comments

There are exactly 87 such numbers, none of them being prime.
Since 0 + 1 +...+ 9 = 5*9, every pandigital number is divisible by 9, hence every term of this sequence is divisible by 3 and so cannot be a prime. - Giovanni Resta, Mar 19 2013 [Comment expanded by N. J. A. Sloane, Jan 15 2022]

Crossrefs

Programs

  • Magma
    [n: n in [Floor(Sqrt(1023456789))..Ceiling(Sqrt(9876543210))] | Set(Intseq(n^2)) eq {0..9}]; // Bruno Berselli, Mar 19 2013 (after Giovanni Resta)
  • Maple
    lim:=floor(sqrt(9876543210)): for n from floor(sqrt(1023456789)) to lim do d:=[op(convert(n^2, base, 10))]: pandig:=true: for k from 0 to 9 do if(numboccur(k, d)<>1)then pandig:=false: break: fi: od: if(pandig)then printf("%d, ",n): fi: od: # Nathaniel Johnston, Jun 22 2011
  • Mathematica
    Select[Range[Floor@Sqrt@1023456789, Ceiling@Sqrt@9876543210], Sort@IntegerDigits[#^2] == Range[0, 9] &] (* Giovanni Resta, Mar 19 2013 *)
    Select[Range[31992,99381,3],Union[DigitCount[#^2]]=={1}&] (* Harvey P. Dale, Jan 17 2022 *)

Formula

a(n) = sqrt(A036745(n)).

A225218 Square numbers containing all the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

Original entry on oeis.org

1026753849, 1042385796, 1098524736, 1237069584, 1248703569, 1278563049, 1285437609, 1382054976, 1436789025, 1503267984, 1532487609, 1547320896, 1643897025, 1827049536, 1927385604, 1937408256, 2076351489, 2081549376, 2170348569, 2386517904, 2431870596
Offset: 1

Views

Author

Reiner Moewald, May 02 2013

Keywords

Comments

The first term having a repeated digit is 10057482369. - Colin Barker, Jan 15 2014

Examples

			1026753849 is in the sequence because 1026753849 = 32043^2 and 1026753849 contains all ten digits 0, ..., 9.
		

Crossrefs

Supersequence of A036745.

Programs

  • Mathematica
    Select[#^2 &[Range[1000000]], Length[Union[IntegerDigits[#]]] == 10 &] (* Geoffrey Critzer, Jan 04 2015 *)
  • PARI
    s=[]; for(n=1, 100000, if(#vecsort(eval(Vec(Str(n^2))), , 8)==10, s=concat(s, n^2))); s \\ Colin Barker, Jan 15 2014
    
  • Python
    from itertools import count, islice
    def c(n): return len(set(str(n))) == 10
    def agen(): yield from (k*k for k in count(31622) if c(k*k))
    print(list(islice(agen(), 21))) # Michael S. Branicky, Dec 27 2022

Formula

a(n) = A054038(n)^2. - Colin Barker, Jan 15 2014

A036744 Penholodigital squares: squares containing each of the digits 1..9 exactly once.

Original entry on oeis.org

139854276, 152843769, 157326849, 215384976, 245893761, 254817369, 326597184, 361874529, 375468129, 382945761, 385297641, 412739856, 523814769, 529874361, 537219684, 549386721, 587432169, 589324176, 597362481, 615387249, 627953481, 653927184, 672935481, 697435281, 714653289, 735982641, 743816529, 842973156, 847159236, 923187456
Offset: 1

Views

Author

Keywords

Comments

Improved Mathematica formula provided. Because the range involved is only from Ceiling[Sqrt[123456789]]=11112 and Floor[Sqrt[987654321]]=31427, it only requires analyzing 20,315 numbers, versus 362,880 permutations of nine digits (as in the current formula). - Harvey P. Dale, Apr 17 2002
Since the sum of the digits is 45, the squares are all divisible by 3, so the given Mathematica formula could be sped up by a factor of 3, checking only multiples of 3 rather than all squares. - Joshua Zucker, Nov 28 2005
Eight-digit analog gives 5 squares: 13527684, 34857216, 65318724, 73256481, 81432576. - Zak Seidov, Mar 01 2011

Crossrefs

Programs

  • Maple
    lim:=floor(sqrt(987654321)): for n from 11112 by 3 to lim do d:=[op(convert(n^2, base, 10))]: pandig:=true: for k from 1 to 9 do if(numboccur(k, d)<>1)then pandig:=false: break: fi: od: if(pandig)then printf("%d, ", n^2): fi: od: # Nathaniel Johnston, Jun 22 2011
  • Mathematica
    Select[Range[11112, 31427]^2, Union[Drop[DigitCount[ # ], -1]] == {1} &]
  • PARI
    A036744 = [n^2 | n <- A071519] \\ or less efficient & more explicit:
    A036744 = [n^2 | n <- [1e5\9..1e5\3], vecsort(digits(n^2)) == [1..9]] \\ M. F. Hasler, Jun 28 2023

Formula

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

Extensions

More terms from Harvey P. Dale, Sep 26 2001
Keyword base added by Reinhard Zumkeller, May 16 2010

A119509 Positive numbers whose square contains no digit more than once.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 16, 17, 18, 19, 23, 24, 25, 27, 28, 29, 31, 32, 33, 36, 37, 42, 43, 44, 48, 49, 51, 52, 53, 54, 55, 57, 59, 61, 64, 66, 69, 71, 72, 73, 74, 78, 79, 82, 84, 86, 87, 89, 93, 95, 96, 98, 99, 113, 116, 117, 118, 124, 126, 128, 133
Offset: 1

Views

Author

Tanya Khovanova, Jul 26 2006

Keywords

Comments

There are exactly 610 terms. a(610) = 99066 and 99066^2 = 9814072356. - Rick L. Shepherd, Jul 27 2006
If we count 0, there is one more term, for a total of 611. - T. D. Noe, Jun 21 2013

Crossrefs

Subsequence of A045540 = numbers whose squares contain an equal number of each digit that they contain. The first number that belongs to A045540 and doesn't belong to this sequence is number 88.

Programs

  • Magma
    [n: n in [1..10^5] | #Set(d) eq #d where d is Intseq(n^2)];  // Bruno Berselli, Aug 02 2011
    
  • Maple
    lim:=floor(sqrt(9876543210)): A119509:={}: for n from 1 to lim do pandig:=true: d:=convert(n^2,base,10): for k from 0 to 9 do if(numboccur(k, d)>1)then pandig:=false: break: fi: od: if(pandig)then A119509 := A119509 union {n}: fi: od: op(sort(convert(A119509,list))); # Nathaniel Johnston, Jun 23 2011
  • Mathematica
    Select[Range[1000000], Length[IntegerDigits[ # ^2]] == Length[Union[IntegerDigits[ # ^2]]] &] (* Tanya Khovanova, May 29 2007 *)
    Select[Range[10^5], Max[DigitCount[#^2]] <= 1 &] (* T. D. Noe, Aug 02 2011 *)
  • PARI
    is_A119509(n)=#(n=digits(n^2))==#Set(n) \\ M. F. Hasler, Sep 08 2017
    
  • Python
    def ok(n): s = str(n**2); return n > 0 and len(set(s)) == len(s)
    afull = [k for k in range(10**5) if ok(k)] # Michael S. Branicky, Nov 27 2022

Extensions

More terms from Rick L. Shepherd, Jul 27 2006

A258103 Number of pandigital squares (containing each digit exactly once) in base n.

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 4, 26, 87, 47, 87, 0, 547, 1303, 3402, 0, 24192, 187562
Offset: 2

Views

Author

Adam J.T. Partridge, May 20 2015

Keywords

Comments

For n = 18, the smallest and largest pandigital squares are 2200667320658951859841 and 39207739576969100808801. For n = 19, they are 104753558229986901966129 and 1972312183619434816475625. For n = 20, they are 5272187100814113874556176 and 104566626183621314286288961. - Chai Wah Wu, May 20 2015
When n is even, (n-1) is a factor of the pandigital squares. When n is odd, (n-1)/2 is a factor with the remaining factors being odd. Therefore, when n is odd and (n-1)/2 has an odd number of 2s as prime factors there are no pandigital squares in base n (e.g. 5, 13, 17 and 21). - Adam J.T. Partridge, May 21 2015
If n is odd and (n-1)/2 has an odd 2-adic valuation, then there are no squares in base n using all the digits from 1 to n-1 once, or all the digits from 0 to n-2 once or all the digits from 1 to n-2 once. This can be proved using the same argument as in the linked blogposts. - Chai Wah Wu, Feb 25 2024

Examples

			For n=4 there is one pandigital square, 3201_4 = 225 = 15^2.
For n=6 there is one pandigital square, 452013_6 = 38025 = 195^2.
For n=10 there are 87 pandigital squares (A036745).
There are no pandigital squares in bases 2, 3, 5 or 13.
Hexadecimal has 3402 pandigital squares, the largest is FED5B39A42706C81.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n%2==1 && valuation(n-1,2)%2==0, 0, my(lim=sqrtint(n^n - (n^n-n)/(n-1)^2), count=0); for(m=sqrtint((n^n-n)/(n-1)^2 + n^(n-2)*(n-1) - 1), lim, if(#Set(digits(m^2,n))==n, count++)); count) \\ Jianing Song, Feb 23 2024. Note that the searching range for m is [sqrt(A049363(n)), sqrt(A062813(n))]
  • Python
    from gmpy2 import isqrt, mpz, digits
    def A258103(n): # requires 2 <= n <= 62
        c, sm, sq = 0, mpz(''.join([digits(i, n) for i in range(n-1, -1, -1)]), n), mpz(''.join(['1', '0']+[digits(i, n) for i in range(2, n)]), n)
        m = isqrt(sq)
        sq = m*m
        m = 2*m+1
        while sq <= sm:
            if len(set(digits(sq, n))) == n:
                c += 1
            sq += m
            m += 2
        return c # Chai Wah Wu, May 20 2015
    

Extensions

a(17)-a(19) from Giovanni Resta, May 20 2015

A370610 Squares such that any two consecutive decimal digits differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

0, 1, 4, 9, 324, 576, 4356, 5476, 23104, 32041, 13527684, 13675204, 17430625, 21307456, 34857216, 35617024, 43507216, 56731024, 65318724, 73256481, 81432576, 102576384, 105637284, 139854276, 152843769, 157326849, 158306724, 176305284, 180472356, 183467025, 187635204
Offset: 1

Views

Author

Jianing Song, Feb 23 2024

Keywords

Comments

Squares in A215014. There are 160 terms in this sequence.

Crossrefs

Cf. A215014, A370370. Supersequence of A036745.
The square roots are given by A370362.

Programs

  • PARI
    isconsecutive(m, {b=10})=my(v=vecsort(digits(m, b))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, b) == 1 if and only if any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order
    a(n) = issquare(n) && isconsecutive(n)
    
  • Python
    from math import isqrt
    from sympy.ntheory import digits
    def afull(): return([i*i for i in range(isqrt(10**10)+1) if len(d:=sorted(str(i*i))) == ord(d[-1])-ord(d[0])+1 == len(set(d))])
    print(afull()) # Michael S. Branicky, Feb 23 2024

A339693 All pandigital squares which contain each digit exactly once in some base b >= 2. The numbers are written in base 10.

Original entry on oeis.org

225, 38025, 314721, 622521, 751689, 3111696, 6002500, 7568001, 10323369, 61058596, 73513476, 74545956, 94517284, 105144516, 112572100, 112656996, 132756484, 136936804, 181980100, 202948516, 210308004, 211353444, 219573124, 222069604, 230614596, 238208356, 251983876
Offset: 1

Views

Author

David Schilling, Dec 13 2020

Keywords

Comments

The sequence consists of all square numbers which when represented in some base b contain all the b digits in that base exactly once.
A225218 has all the squares in base 10 that are pandigital. This sequence is the union of all such sequences in any integer base b >= 2.

Examples

			15^2 in base 4 (225 is 3201 in base 4) contains the digits 0-3.
195^2 in base 6 (38025 is 452013 in base 6) contains the digits 0-5.
The next three terms contain all the digits in base 7.
The following four entries are pandigital in base 8, the next 26 in base 9, and so on.
		

Crossrefs

Programs

  • JAI
    #import "Basic";
    dstr := "0123456789abcdef";
    main :: () {
        digits : [16] int;
        for j:2..3_000_000 {
            for b:3..16 {
                for d : 0..15
                    digits[d] = 0;
                k := j*j;
                s := tprint( "%",  formatInt( k, b ) );
                if s.count > b
                    continue;
                for d : 0..s.count-1 {
                    for c : 0..dstr.count-1 {
                        if s[d] == dstr[c] {
                            digits[c] += 1;
                            continue d;
                        }
                    }
                }
                for d : 0..b-1 {
                    if digits[d] != 1
                        continue b;
                }
                print( "%, ", k );
            }
        }
    }
    
  • PARI
    \\ here ispandig(n) returns base if n is pandigital, otherwise 0.
    ispandig(n)={for(b=2, oo, my(r=logint(n,b)+1); if(rAndrew Howroyd, Dec 20 2020

A359346 Reversible pandigital square numbers.

Original entry on oeis.org

1234549876609, 9066789454321, 123452587690084, 123454387666009, 123454987660900, 123456987654400, 123458987664100, 123478988652100, 125688987432100, 146678985432100, 445678965432100, 480096785254321, 900666783454321, 906678945432100, 10223418547690084
Offset: 1

Views

Author

Martin Renner, Dec 27 2022

Keywords

Comments

These are perfect squares containing each digit from 0 to 9 at least once and still remain square numbers (not necessarily of the same length) when reversing the digits.
In 1905, inspired by a question about all pandigital square numbers containing each digit from 0 to 9 exactly once (cf. A036745, A156977), the British mathematician Allan Cunningham (1842-1928) asked for reversible and palindromic pandigital square numbers. In his answer, he gives possible solutions, but actually not the least possible numbers he was asking for in his question.

Examples

			Sequence starts with 1111103^2 = 1234549876609 <~> 9066789454321 = 3011111^2, which is the smallest possible such number.
		

Crossrefs

Programs

  • PARI
    isok(k) = if (issquare(k), my(d=digits(k)); (#Set(d) == 10) && issquare(fromdigits(Vecrev(d)));); \\ Michel Marcus, Dec 31 2022
  • Python
    from math import isqrt
    from itertools import count, islice
    def c(n): return len(set(s:=str(n)))==10 and isqrt(r:=int(s[::-1]))**2==r
    def agen(): yield from (k*k for k in count(10**6) if c(k*k))
    print(list(islice(agen(), 15))) # Michael S. Branicky, Dec 27 2022
    

A261213 Odd numbers n such that n^2 = m + (m+1), where both m and m+1 have no repeated digits.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 23, 27, 29, 31, 35, 37, 39, 41, 43, 57, 63, 69, 77, 81, 87, 89, 95, 109, 113, 121, 125, 127, 129, 137, 163, 193, 219, 239, 271, 273, 279, 281, 285, 305, 311, 315, 331, 339, 353, 357, 377, 381, 395, 403, 409, 435, 441, 443, 597
Offset: 1

Views

Author

Pieter Post, Aug 12 2015

Keywords

Comments

This sequence is finite and a(146) = 40797 is the last term. 40797^2 = 1664395209 and 1664395209 = 832197604 + 832197605. These last two numbers both have no repeating digits.

Examples

			5 is in the sequence, because 5^2 = 25. 25 = 12 + 13. 12 and 13 both have no repeating digits.
		

Crossrefs

Programs

  • Mathematica
    nr[n_] := 1 == Max@ DigitCount@ n; Select[ Range[1, 10^5, 2], nr[x= Floor[#^2 / 2]] && nr[x + 1] &] (* Giovanni Resta, Aug 12 2015 *)

A359341 Number of pandigital squares with n digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 504, 4275, 29433, 179235, 955818, 4653802, 21034628, 89834238, 366490378, 1440743933, 5493453262
Offset: 1

Views

Author

Martin Renner, Dec 27 2022

Keywords

Comments

Pandigital squares are perfect squares containing each digit from 0 to 9 at least once.

Examples

			a(n) = 0 for n < 10, since a number must have at least ten digits to contain all digits from 0 to 9 at least once.
a(10) = 87 since there are 87 ten-digit pandigital squares from 1026753849 to 9814072356 (cf. A036745) containing each digit from 0 to 9, here exactly once.
		

Crossrefs

Programs

  • Maple
    a:=proc(n::posint) local p,k,K: if n<10 then p:=0; else p:=0: for k from ceil(sqrt(10^(n-1))) to floor(sqrt(10^n)) do K:=convert(k^2,base,10); if nops({op(K)})=10 then p:=p+1: fi: od: fi: return p; end:
  • Python
    from math import isqrt
    def c(n): return len(set(str(n))) == 10
    def a(n):
        lb = isqrt(10**(n-1)) if n&1 else isqrt(10**(n-1)) + 1
        return sum(1 for k in range(lb, isqrt(10**n-1)+1) if c(k*k))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, Dec 27 2022

Extensions

a(19)-a(21) from Michael S. Branicky, Dec 27 2022
Showing 1-10 of 11 results. Next