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

A245631 Least number k such that n concatenated with k produces a cube.

Original entry on oeis.org

25, 7, 43, 913, 12, 4, 29, 5184, 261, 648, 7649, 5, 31, 8877, 625, 6375, 28, 5193, 683, 5379, 6, 6981, 8328, 389, 15456, 2144, 44, 7496, 791, 48625, 4432, 768, 75, 3, 937, 52264, 3248, 9017, 304, 96, 73281, 875, 8976, 10944, 6533, 656, 4552, 26809, 13, 653, 2, 68024, 1441, 872, 1368, 39752, 1787, 32, 319
Offset: 1

Views

Author

Derek Orr, Jul 27 2014

Keywords

Examples

			20, 21, 22, 23, 24, 25, and 26 are not cubes. 27 is a cube. Thus a(2) = 7.
		

Crossrefs

Cf. A071176.

Programs

  • Mathematica
    lnc[n_]:=Module[{k=1},While[!IntegerQ[Surd[n*10^IntegerLength[k]+k,3]],k++];k]; Array[lnc,60] (* Harvey P. Dale, Aug 08 2019 *)
  • PARI
    a(n)=p="";for(k=0,10^6,p=concat(Str(n),Str(k));if(ispower(eval(p))&&ispower(eval(p))%3==0,return(k)))
    n=1;while(n<100,print1(a(n),", ");n++)
    
  • Python
    from sympy import integer_nthroot
    def A245631(n):
        m = 10*n
        if integer_nthroot(m,3)[1]: return 0
        a = 1
        while (k:=(integer_nthroot(a*(m+1)-1,3)[0]+1)**3-m*a)>=10*a:
            a *= 10
        return k # Chai Wah Wu, Feb 15 2023

A071177 Square-root of concatenation n'k, where k is minimal with n'k square (decimal notation).

Original entry on oeis.org

4, 5, 6, 7, 23, 8, 27, 9, 31, 10, 34, 11, 37, 12, 39, 13, 42, 43, 14, 45, 46, 15, 152, 156, 16, 162, 165, 17, 54, 55, 56, 18, 58, 59, 188, 19, 61, 62, 63, 20, 203, 65, 66, 21, 213, 68, 69, 22, 222, 71, 72, 23, 73, 74, 235, 75, 24, 242
Offset: 1

Views

Author

Reinhard Zumkeller, May 15 2002

Keywords

Comments

a(n) = A000196(n'A071176(n))

Examples

			a(5) = 23 as 23^2 = 529 = 5'29 and 5'i is nonsquare for i<29, A071176(5)=29.
		

Programs

  • Python
    from math import isqrt
    def A071177(n):
        m = 10*n
        if (k:=isqrt(m))**2!=m:
            a = 1
            while (k:=isqrt(a*(m+1)-1)+1)**2-m*a>=10*a:
                a *= 10
        return k # Chai Wah Wu, Feb 15 2023

A245632 Least number k such that n concatenated with k is a perfect power.

Original entry on oeis.org

6, 5, 2, 9, 12, 4, 29, 1, 61, 0, 56, 1, 31, 4, 21, 9, 28, 49, 6, 25, 6, 5, 104, 3, 6, 244, 44, 9, 16, 25, 25, 4, 64, 3, 344, 1, 21, 44, 69, 0, 209, 25, 56, 1, 369, 24, 61, 4, 13, 41, 2, 9, 29, 76, 225, 25, 6, 32, 29, 84, 504, 5, 504, 516, 61, 564, 6, 59, 169, 56, 289, 9, 96, 529, 69, 176, 44, 4, 21, 656
Offset: 1

Views

Author

Derek Orr, Jul 27 2014

Keywords

Examples

			16 is the smallest perfect power > 9 beginning with 1. Thus a(1) = 6.
		

Crossrefs

Programs

  • Maple
    conc:= proc(n,k) if k = 0 then 10*n else 10^(1+ilog10(k))*n+k fi end proc:
    ispow:= proc(x) local F; F:= ifactors(x)[2];
    evalb(igcd(seq(f[2],f=F))>1) end proc:
    a:= proc(n) local k; for k from 0 do if ispow(conc(n,k)) then return k fi od end proc;
    seq(a(n),n=1..100); # Robert Israel, Jul 28 2014
  • PARI
    a(n)=p="";for(k=0,oo,p=concat(Str(n),Str(k));if(ispower(eval(p)),return(k)))
    n=1;while(n<100,print1(a(n),", ");n++)
    
  • Python
    from sympy import perfect_power
    def a(n):
        s, k = str(n), 0
        while not perfect_power(int(s+str(k))): k += 1
        return k
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Jun 05 2021

A246560 Least number k such that k concatenated with n is a square, or 0 if no such k exists.

Original entry on oeis.org

8, 0, 0, 6, 2, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 1, 0, 0, 3, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 4, 0, 0, 1, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 17, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 16, 0, 0, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 23
Offset: 1

Views

Author

Derek Orr, Aug 29 2014

Keywords

Comments

a(n) = 0 if and only if n is in A246448.

Examples

			The smallest square ending with 5 is 25, so a(5) = 2.
		

Crossrefs

Programs

  • PARI
    b(n)=v=[];for(k=10^(n-1),10^n,v=concat(v,k^2%10^n));v=vecsort(v,,8);v
    w=[];for(k=1,250,d=digits(k);if(vecsearch(b(#d),k),w=concat(w,k)));w=vecsort(w,,8);w;
    a(n)=if(!vecsearch(w,n),return(0));if(vecsearch(w,n),j=1;s=Str(n);while(!issquare(eval(concat(Str(j),s))),j++);return(j))
    vector(200,n,a(n))

A359800 a(n) is the least m such that the concatenation of n^2 and m is a square.

Original entry on oeis.org

6, 9, 61, 9, 6, 1, 284, 516, 225, 489, 104, 4, 744, 249, 625, 3201, 444, 9, 201, 689, 4201, 416, 984, 4801, 681, 5201, 316, 996, 5801, 601, 6201, 144, 936, 6801, 449, 7201, 7401, 804, 7801, 225, 8201, 8401, 6, 8801, 9001, 9201, 9401, 324, 9801, 19344, 769, 38025
Offset: 1

Views

Author

Mohammed Yaseen, Jan 13 2023

Keywords

Comments

The only one-digit terms are 1, 4, 6 and 9. Proof: Squares mod 10 are 0, 1, 4, 5, 6 and 9. Concatenation of a square and 0 is 10 times that square, which is not a square. So 0 is ruled out. Squares with last digit 5 have second last digit 2. Since no square ends in 2, 5 is also ruled out.
From Thomas Scheuerle, Jan 14 2023: (Start)
The only term with two digits is a(3) = 61.
Some terms with an odd number of digits appear infinitely often, for example, 516 for n = 8, 1352, 632958674, ... .
If a term has an even number of digits and is of the form 1+2*k*10^(d+1) with 10^d <= 2*k < 10^(d+1), then it appears only once at k = n in this sequence. Are terms with an even number of digits possible which are not of this form? (End)

Examples

			For n=3, 61 is the least number m such that the concatenation of 3^2 and m is a square: 961 = 31^2. So a(3) = 61.
For n=7, 284 is the least number m such that the concatenation of 7^2 and m is a square: 49284 = 222^2. So a(7) = 284.
		

Crossrefs

Programs

  • PARI
    a(n)={my(m=n^2, b=1); while(1, m*=10; my(r=(sqrtint(m+b-1)+1)^2-m); b*=10; if(rAndrew Howroyd, Jan 13 2023
  • Python
    from math import isqrt
    def a(n):
        t, k = str(n*n), isqrt(10*n**2)
        while not (s:=str(k*k)).startswith(t) or s[len(t)]=="0": k += 1
        return int(s[len(t):])
    print([a(n) for n in range(1, 53)]) # Michael S. Branicky, Jan 15 2023
    
  • Python
    from math import isqrt
    from sympy.ntheory.primetest import is_square
    def A359800(n):
        m = 10*n*n
        if is_square(m): return 0
        a = 1
        while (k:=(isqrt(a*(m+1)-1)+1)**2-m*a)>=10*a:
            a *= 10
        return k # Chai Wah Wu, Feb 15 2023
    

Formula

a(n) = A071176(n^2) = A071176(A000290(n)).
From Thomas Scheuerle, Jan 13 2023: (Start)
a(A084070(n)) = 1.
a(2*A084070(n)) = 4.
a(A221874(n)) = 6.
a(A075836(n)) = 9. (End)
Showing 1-5 of 5 results.