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.

A370362 Numbers k such that any two consecutive decimal digits of k^2 differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 18, 24, 66, 74, 152, 179, 3678, 3698, 4175, 4616, 5904, 5968, 6596, 7532, 8082, 8559, 9024, 10128, 10278, 11826, 12363, 12543, 12582, 13278, 13434, 13545, 13698, 14442, 14676, 14766, 15681, 15963, 16854, 17529, 17778, 18072, 19023, 19377, 19569, 19629
Offset: 1

Views

Author

Jianing Song, Feb 16 2024

Keywords

Comments

Numbers k such that k^2 is in A215014. There are 160 terms in this sequence.

Examples

			18^2 = 324 consists of the consecutive digits 2, 3 and 4;
24^2 = 576 consists of the consecutive digits 5, 6 and 7;
66^2 = 4356 consists of the consecutive digits 3, 4, 5 and 6;
74^2 = 5476 consists of the consecutive digits 4, 5, 6 and 7.
		

Crossrefs

Cf. A215014, A370370. Supersequence of A156977.
The actual squares are given by A370610.

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) = isconsecutive(n^2)
    
  • Python
    from math import isqrt
    from sympy.ntheory import digits
    def afull(): return([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

A370371 Largest m such that any two consecutive digits of the base-n expansion of m^2 differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

1, 1, 15, 2, 195, 867, 3213, 18858, 99066, 528905, 2950717, 294699, 105011842, 659854601, 4285181505, 1578809181, 198009443151, 1404390324525, 10225782424031, 3635290739033, 583655347579584, 4564790605900107, 36485812146621733, 297764406866494254, 2479167155959358950
Offset: 2

Views

Author

Jianing Song, Feb 16 2024

Keywords

Comments

By definition, a(n) <= sqrt(Sum_{i=0..n-1} i*n^i) = sqrt(A062813(n)). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= sqrt(Sum_{i=1..n-1} i*n^(i-1)) = sqrt(A051846(n-1)); see A258103.
If n is odd and n-1 has an even 2-adic valuation, then a(n) <= sqrt(Sum_{i=2..n-1} i*n^(i-2)); see A258103. - Chai Wah Wu, Feb 25 2024

Examples

			Base 4: 15^2 = 225 = 3201_4;
Base 6: 195^2 = 38025 = 452013_6;
Base 7: 867^2 = 751689 = 6250341_7;
Base 8: 3213^2 = 10323369 = 47302651_8;
Base 9: 18858^2 = 355624164 = 823146570_9;
Base 10: 99066^2 = 9814072356;
Base 11: 528905^2 = 279740499025 = A8701245369_11;
Base 12: 2950717^2 = 8706730814089 = B8750A649321_12;
Base 13: 294699^2 = 86847500601 = 8260975314_13.
		

Crossrefs

Cf. A215014, A370362, A370370, A258103 (number of pandigital squares in base n).
The actual squares are given by A370611.

Programs

  • PARI
    isconsecutive(m,n)=my(v=vecsort(digits(m,n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k,n) == 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) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2,n), return(m)))
    
  • Python
    from math import isqrt
    from sympy import multiplicity
    from sympy.ntheory import digits
    def a(n):
        ub = isqrt(sum(i*n**i for i in range(n)))
        if n%2 == 1 and multiplicity(2, n-1)%2 == 0:
            ub = isqrt(sum(i*n**(i-2) for i in range(2, n)))
        return(next(i for i in range(ub, -1, -1) if len(d:=sorted(digits(i*i, n)[1:])) == d[-1]-d[0]+1 == len(set(d))))
    print([a(n) for n in range(2, 13)]) # Michael S. Branicky, Feb 23 2024

Extensions

a(17)-a(20) and a(22)-a(26) from Michael S. Branicky, Feb 23 2024
a(21) from Chai Wah Wu, Feb 25 2024

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

A370611 Largest square such that any two consecutive digits of its base-n expansion differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

1, 1, 225, 4, 38025, 751689, 10323369, 355624164, 9814072356, 279740499025, 8706730814089, 86847500601, 11027486960232964, 435408094460869201, 18362780530794065025, 2492638430009890761, 39207739576969100808801, 1972312183619434816475625, 104566626183621314286288961, 13215338757299095309775089
Offset: 2

Views

Author

Jianing Song, Feb 23 2024

Keywords

Comments

By definition, a(n) <= Sum_{i=0..n-1} i*n^i = A062813(n). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= Sum_{i=1..n-1} i*n^(i-1) = A051846(n-1); see A258103.
If n is odd and n-1 has an even 2-adic valuation, then a(n) <= Sum_{i=2..n-1} i*n^(i-2); see A258103. - Chai Wah Wu, Feb 25 2024

Examples

			See the Example section of A370371.
		

Crossrefs

Cf. A215014, A370370, A370610, A258103 (number of pandigital squares in base n).
The square roots are given by A370371.

Programs

  • PARI
    isconsecutive(m, n)=my(v=vecsort(digits(m, n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, n) == 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) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2, n), return(m^2)))

Extensions

a(17)-a(20) from Michael S. Branicky, Feb 23 2024
a(21) from Chai Wah Wu, Feb 25 2024
Showing 1-4 of 4 results.