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

A001704 a(n) = n concatenated with n + 1.

Original entry on oeis.org

12, 23, 34, 45, 56, 67, 78, 89, 910, 1011, 1112, 1213, 1314, 1415, 1516, 1617, 1718, 1819, 1920, 2021, 2122, 2223, 2324, 2425, 2526, 2627, 2728, 2829, 2930, 3031, 3132, 3233, 3334, 3435, 3536, 3637, 3738, 3839, 3940, 4041, 4142, 4243, 4344, 4445, 4546
Offset: 1

Views

Author

Keywords

Comments

See A030457 for the indices of prime terms in this sequence. - Reinhard Zumkeller, Jun 27 2015 [Simplified by Jianing Song, Jan 27 2019]

Crossrefs

See A127421 for a version with offset 0.

Programs

  • Haskell
    a001704 n = a001704_list !! (n-1)
    a001704_list = map read (zipWith (++) iss $ tail iss) :: [Integer]
                   where iss = map show [1..]
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [Seqint(Intseq(n+1) cat Intseq(n)): n in [1..50]]; // Vincenzo Librandi, Jul 08 2018
    
  • Maple
    f:=proc(i) i*10^(1+floor(evalf(log10(i+1), 10)))+i+1; end: # gives a(n) - N. J. A. Sloane, Aug 04 2012
    # alternative Maple program:
    a:= n-> parse(cat(n, n+1)):
    seq(a(n), n=1..55);  # Alois P. Heinz, Jul 05 2018
  • Mathematica
    Table[FromDigits@Flatten@IntegerDigits[{n, n + 1}], {n, 100}] (* T. D. Noe, Aug 09 2012 *)
  • PARI
    a(n)=eval(Str(n,n+1)) \\ Charles R Greathouse IV, Jul 23 2016
    (Emacs Lisp)
    ;; Concatenation
    (defun A001704 (n) (string-to-int (concat (int-to-string n) (int-to-string (1+ n)))))
    ;; Formula
    (defun A001704 (n) (1+ n (* n (expt 10 (1+ (floor (log (1+ n) 10)))))))
    (mapcar '(lambda (n) (cons n (A001704 n))) '(1 2 3 10 11 12 99 999)) => ((1 . 12) (2 . 23) (3 . 34) (10 . 1011) (11 . 1112) (12 . 1213) (99 . 99100) (999 . 9991000))
    ; Tim Chambers, Jul 07 2018
    
  • Python
    for n in range(1,100): print(str(n)+str(n+1)) # David F. Marrs, Sep 17 2018
    
  • Scala
    val numerStrs = (1 to 50).map(Integer.toString(_)).toList
    val concats = (numerStrs.dropRight(1)) zip (numerStrs.drop(1))
    concats.map(x => Integer.parseInt(x.1 + x._2)) // _Alonso del Arte, Oct 24 2019

Extensions

More terms from Joshua Zucker and Jon E. Schoenfield, May 15 2007

A341715 a(n) = smallest prime of the form n||n+1||n+2||...||n+k, where || denotes decimal concatenation, or -1 if no such prime exists.

Original entry on oeis.org

2, 3, 4567, 5, 67, 7, 89
Offset: 2

Views

Author

N. J. A. Sloane, Feb 21 2021

Keywords

Comments

a(1) is unknown, but is believed to exist (see A007908). The corresponding value of k, if it exists, is known to be at least 300000, so in any case this prime would be too large to include in an OEIS entry, which is why this sequence has offset 2.
a(9) = 9||10||...||187 (see Example section), but that is too large to show in the data field. a(A030457(n)) = A030457(n)||A030457(n)+1 and k = 1 for n > 1. If m is in A030470 but not in A030457, then a(m) = m||m+1||m+2||m+3 and k = 3. Of course a(p) = p and k = 0 for p prime. - Chai Wah Wu, Feb 22 2021
For the corresponding values of k and n+k, see A341716 and A341717.
See also A140793 = (23, 345...109, 4567, 567...17, ...), A341720, and A084559 for the variant with k >= 1, so that a(n) > n also for prime n. - M. F. Hasler, Feb 22 2021

Examples

			Starting at 12, 13, 14, 15, 17, 19, 20 we get the primes 1213, 13, 14151617, 1516171819, 17, 19, 20212223, which are all terms of this sequence.
Here is a(9) from _Chai Wah Wu_, Feb 22 2021, a 445-digit number:
910111213141516171819202122232425262728293031323334353637383940414243444546\
    47484950515253545556575859606162636465666768697071727374757677787980818\
    28384858687888990919293949596979899100101102103104105106107108109110111\
    11211311411511611711811912012112212312412512612712812913013113213313413\
    51361371381391401411421431441451461471481491501511521531541551561571581\
    59160161162163164165166167168169170171172173174175176177178179180181182\
    183184185186187
a(16) = 16||17||...||43 is prime. Also for a(10), I searched up to k <= 10000, so if it exists it will have tens of thousands of decimal digits. Some other big terms are: for n = 18, k = 3589; for n = 35, k = 568; for n = 66, k = 937; for n = 275, k = 814.  - _Chai Wah Wu_, Feb 22 2021
		

Crossrefs

If k in the definition is allowed to be zero we get [the present sequence, A341716, A341717], but if we require k>0 we get [A140793, A341720, A084559].
See A075022 for the largest prime factor of 1||2||...||n.

Programs

  • Mathematica
    Array[Block[{k = #, s = #}, While[! PrimeQ[s], k++; s = FromDigits[IntegerDigits[s]~Join~IntegerDigits[k]]]; s] &, 8, 2] (* Michael De Vlieger, Feb 22 2021 *)
  • PARI
    A341715(n)=if(isprime(n),n,eval(concat([Str(k)|k<-[n..A084559(n)]]))) \\ M. F. Hasler, Feb 22 2021
  • Python
    from sympy import isprime
    def A341715(n):
        m, k = n, n
        while not isprime(m):
            k += 1
            m = int(str(m)+str(k))
        return m # Chai Wah Wu, Feb 22 2021
    

Formula

a(n) = concatenate(n, ..., A084559(n)) or a(n) = n if n is prime. - M. F. Hasler, Feb 22 2021

A054211 Numbers k such that k concatenated with k-1 is prime.

Original entry on oeis.org

4, 10, 22, 24, 34, 42, 58, 70, 78, 88, 100, 102, 108, 112, 114, 124, 148, 154, 160, 172, 180, 192, 198, 202, 208, 210, 214, 238, 244, 262, 264, 268, 270, 282, 294, 300, 304, 312, 328, 330, 334, 340, 342, 354, 372, 384, 390, 394, 412, 414, 420, 424, 444, 454
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

A010051(A127423(a(n))) = 1. - Reinhard Zumkeller, Jun 27 2015
All terms are even. - Michel Marcus, Oct 14 2016

Crossrefs

Programs

  • Haskell
    a054211 n = a054211_list !! (n-1)
    a054211_list = filter ((== 1) . a010051' . a127423) [1..]
    -- Reinhard Zumkeller, Jun 27 2015 Jul 15 2012
    
  • Mathematica
    ncpQ[{a_,b_}]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{b,a}]]]]; Transpose[ Select[Partition[Range[500],2,1],ncpQ]][[2]] (* Harvey P. Dale, Nov 25 2012 *)
    Select[Range[500],PrimeQ[#*10^IntegerLength[#-1]+#-1]&] (* Harvey P. Dale, Mar 16 2019 *)
  • PARI
    isok(n) = isprime(eval(Str(n, n-1))); \\ Michel Marcus, Oct 14 2016

A032662 a(n) is the least k such that k concatenated with k + n is prime.

Original entry on oeis.org

1, 2, 1, 4, 3, 12, 1, 2, 1, 2, 3, 6, 1, 6, 3, 4, 5, 4, 5, 8, 7, 2, 21, 10, 17, 2, 1, 2, 3, 4, 1, 2, 7, 14, 3, 4, 1, 2, 1, 2, 11, 6, 5, 18, 3, 4, 3, 6, 1, 2, 1, 8, 5, 4, 7, 2, 1, 4, 5, 4, 11, 2, 1, 4, 3, 12, 1, 2, 9, 2, 3, 6, 1, 8, 9, 2, 3, 6, 1, 2, 1, 2, 5, 4, 929, 6, 3, 4, 5, 12, 1, 2, 1
Offset: 0

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

First terms of sequences '1', A030457, A032617-A032624, continued with displacements d > 9.

Examples

			a(22) = 21: the concatenation of 21 and 21 + 22 = 43 is 2143 and this is a prime.
		

Crossrefs

Cf. A032663.

Programs

  • Maple
    tcat:= (a,b) -> a*10^(1+ilog10(b))+b:
    f:= proc(n) local k;
      for k from 1 + (n mod 2) by 2 do
         if isprime(tcat(k,k+n)) then return k fi
      od;
    end proc:
    map(f, [$0..100]); # Robert Israel, Sep 05 2024

Extensions

Edited by Robert Israel, Sep 05 2024

A068700 The concatenation of n with n-1 and n with n+1 both yield primes (twin primes).

Original entry on oeis.org

42, 78, 102, 108, 180, 192, 270, 300, 312, 330, 342, 390, 420, 522, 540, 612, 660, 822, 840, 882, 1002, 1140, 1230, 1272, 1482, 1542, 1632, 1770, 2100, 2190, 2682, 2742, 3072, 3198, 3408, 3642, 3828, 4242, 4452, 4572, 4740, 4788, 4998, 5622, 5718, 5832
Offset: 1

Views

Author

Amarnath Murthy, Mar 04 2002

Keywords

Comments

All terms are congruent to {0, 12, 18} mod 30. - Zak Seidov, Oct 24 2014
a(n) = 2 * A102478(n). - Reinhard Zumkeller, Jun 27 2015

Examples

			42 is a member as 4241 as well as 4243 are primes.
		

Crossrefs

Common terms of A030458 and A052089.
Intersection of A030457 and A054211; A102478.

Programs

  • Haskell
    import Data.List.Ordered (isect)
    a068700 n = a068700_list !! (n-1)
    a068700_list = isect a030457_list a054211_list
    -- Reinhard Zumkeller, Jun 27 2015
  • Maple
    filter:= proc(n)
    local d;
    d:= ilog10(n)+1;
    isprime(n*10^d+n-1) and isprime(n*10^d+n+1)
    end proc:
    select(filter, [$1..10^5]); # Robert Israel, Oct 24 2014
  • Mathematica
    d[n_]:=IntegerDigits[n]; conQ[n_]:=And@@PrimeQ[FromDigits/@{Join[d[n],d[n+1]],Join[d[n],d[n-1]]}]; Select[Range[5850],conQ[#] &] (* Jayanta Basu, May 21 2013 *)
  • PARI
    for(n=2,200, if(isprime(n*10^ceil(log(n-1)/log(10))+n-1)*isprime(n*10^ceil(log(n+1)/log(10))+n+1)==1,print1(n,",")))
    

Extensions

More terms from Benoit Cloitre, Mar 09 2002

A275319 Numbers n such that n concatenated with n+1 is not a prime.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Vincenzo Librandi, Jul 23 2016

Keywords

Comments

Complement of A030457.
Conjecture: a(n) ~ n. - Charles R Greathouse IV, Jul 23 2016

Crossrefs

Cf. A030457.

Programs

  • Magma
    [n: n in [1..500] | not IsPrime(Seqint(Intseq(n+1) cat Intseq(n)))]
    
  • Mathematica
    Select[Range[100], !PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[# + 1]]]] &]
  • PARI
    is(n)=!isprime(eval(Str(n,n+1))) \\ Charles R Greathouse IV, Jul 23 2016

A275238 a(n) = n*(10^floor(log_10(n)+1) + 1) + (-1)^n.

Original entry on oeis.org

1, 10, 23, 32, 45, 54, 67, 76, 89, 98, 1011, 1110, 1213, 1312, 1415, 1514, 1617, 1716, 1819, 1918, 2021, 2120, 2223, 2322, 2425, 2524, 2627, 2726, 2829, 2928, 3031, 3130, 3233, 3332, 3435, 3534, 3637, 3736, 3839, 3938, 4041, 4140, 4243, 4342, 4445, 4544, 4647, 4746, 4849, 4948, 5051, 5150, 5253, 5352, 5455, 5554
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 21 2016

Keywords

Comments

Concatenation of n with n+(-1)^n (A004442).
Subsequence of A248378.
Primes in this sequence: 23, 67, 89, 1213, 3637, 4243, 5051, 5657, 6263, 6869, 7879, 8081, 9091, 9293, 9697, 102103, ... (A030458).
Numbers n such that a(n) is prime: 2, 6, 8, 12, 36, 42, 50, 56, 62, 68, 78, 80, 90, 92, 96, 102, 108, 120, 126, 138, ... (A030457).

Examples

			a(0) =  0 + 1 = 1;
a(1) = 11 - 1 = 10;
a(2) = 22 + 1 = 23;
a(3) = 33 - 1 = 32;
a(4) = 44 + 1 = 45;
a(5) = 55 - 1 = 54, etc.
or
a(0) =  1 -> concatenation of 0 with 0 + (-1)^0 = 1;
a(1) = 10 -> concatenation of 1 with 1 + (-1)^1 = 0;
a(2) = 23 -> concatenation of 2 with 2 + (-1)^2 = 3;
a(3) = 32 -> concatenation of 3 with 3 + (-1)^3 = 2;
a(4) = 45 -> concatenation of 4 with 4 + (-1)^4 = 5;
a(5) = 54 -> concatenation of 5 with 5 + (-1)^5 = 4, etc.
........................................................
a(2k) = 1, 23, 45, 67, 89, 1011, 1213, 1415, 1617, 1819, ...
		

Crossrefs

Programs

  • Mathematica
    Table[n (10^Floor[Log[10, n] + 1] + 1) + (-1)^n, {n, 0, 55}]
  • PARI
    a(n) = if(n, n*(10^(logint(n,10)+1) + 1) + (-1)^n, 1) \\ Charles R Greathouse IV, Jul 21 2016

Formula

a(n) = A020338(n) + A033999(n).
a(2k) = A030656(k).
A064834(a(n)) > 0, for n > 0.
a(n) ~ 10*n*10^floor(c*log(n)), where c = 1/log(10) = 0.4342944819... = A002285.
Showing 1-7 of 7 results.