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

A309808 Primes formed by concatenating k and 2k+1.

Original entry on oeis.org

13, 37, 613, 919, 1021, 1123, 1327, 1429, 1531, 2143, 2347, 2551, 2857, 3061, 3163, 3469, 3571, 3673, 3877, 4591, 4999, 50101, 56113, 59119, 63127, 70141, 71143, 74149, 78157, 79159, 81163, 88177, 91183, 93187, 95191, 101203, 105211, 106213, 108217, 110221, 113227, 114229
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 17 2019

Keywords

Comments

Primes in A309809.

Examples

			a(3)=613 is the concatenation of 6 and 2*6+1=13 and is prime.
		

Crossrefs

Programs

  • Magma
    [a:m in [1..130]|IsPrime(a) where a is 10^(#Intseq(2*m+1))*m+2*m+1]; // Marius A. Burtea, Aug 18 2019
  • Maple
    select(isprime, [seq(n*10^(1+ilog10(2*n+1))+2*n+1,n=1..200)]);

A309828 Squares formed by concatenating k and 2*k+1.

Original entry on oeis.org

25, 49, 1225, 4489, 112225, 444889, 11122225, 44448889, 816416329, 1111222225, 1451229025, 3832476649, 4444488889, 111112222225, 444444888889, 10185602037121, 11111122222225, 44444448888889, 46355849271169, 997230019944601, 1111111222222225, 1231148024622961
Offset: 1

Views

Author

Marius A. Burtea, Aug 18 2019

Keywords

Comments

The sequence is infinite. The squares of the form 66...67^2 = 4..48..89 are terms.
Another infinite family is the squares 33...35^2 = 1...122...25. - Robert Israel, Aug 20 2019

Examples

			5^2 = 25 = 2_(2 * 2 + 1);
7^2 = 49 = 4_(2 * 4 + 1);
35^2 = 1225 = 12_(2 * 12 + 1);
61907^2 = 3832476649 = 38324_(2 * 38324 + 1).
		

References

  • Ion Cucurezeanu, Perfect squares and cubes of integers, Ed. Gil, Zalău, (2007), ch. 4, p. 25, pr. 211, 212 (in Romanian).

Crossrefs

Programs

  • Magma
    [a:n in [1..30000000]|IsSquare(a) where a is 10^(#Intseq(2*n+1))*n+2*n+1];
    
  • Maple
    F:= proc(m) local x,X,A;
      X:= [numtheory:-rootsunity(2,10^m+2)];
      A:= map(x -> (x^2-1)/(10^m+2), X);
      A:= sort(select(x -> 2*x+1>=10^(m-1) and 2*x+1<10^m, A));
      op(map(x -> x*10^m+2*x+1, A))
    end proc:
    subsop(1=NULL, [seq(F(m),m=1..10)]); # Robert Israel, Aug 20 2019
  • Mathematica
    Select[Array[FromDigits@ Flatten@ IntegerDigits[{#, 2 # + 1}] &, 10^5],
    IntegerQ@ Sqrt@ # &] (* Michael De Vlieger, Aug 19 2019 *)
  • Python
    def Test(n):
        s = str(n)
        ps, ss = s[0:len(s)//2], s[len(s)//2:len(s)]
        return int(ss) == 2*int(ps)+1 and s[len(s)//2] != "0"
    n, a = 1, 4
    while n < 23:
        if Test(a*a):
            print(n,a*a)
            n = n+1
        a = a+1 # A.H.M. Smeets, Aug 19 2019
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.primetest import is_square
    def A309828_gen(): # generator of terms
        return filter(is_square,(int(str(k)+str((k<<1)+1)) for k in count(1)))
    A309828_list = list(islice(A309828_gen(),20)) # Chai Wah Wu, Feb 20 2023
Showing 1-2 of 2 results.