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.

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

A127423 a(1) = 1; for n > 1, a(n) = n concatenated with n - 1.

Original entry on oeis.org

1, 21, 32, 43, 54, 65, 76, 87, 98, 109, 1110, 1211, 1312, 1413, 1514, 1615, 1716, 1817, 1918, 2019, 2120, 2221, 2322, 2423, 2524, 2625, 2726, 2827, 2928, 3029, 3130, 3231, 3332, 3433, 3534, 3635, 3736, 3837, 3938, 4039, 4140, 4241, 4342, 4443, 4544, 4645
Offset: 1

Views

Author

Artur Jasinski, Jan 14 2007

Keywords

Comments

a(1) could also have been defined to be 10. In that case the initial terms would be 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 1110, 1211, 1312, 1413, 1514, 1615, 1716, 1817, 1918, 2019, 2120, 2221, 2322, 2423, 2524, 2625, 2726, 2827, 2928, 3029, 3130, 3231, 3332, 3433, ... (Comment added in case someone is searching for that sequence.) - N. J. A. Sloane, Aug 11 2018
A010051(a(A054211(n))) = 1. - Reinhard Zumkeller, Jun 27 2015

Examples

			a(12) = 1211 because 12 and 11 are two consecutive decreasing numbers.
		

Crossrefs

Programs

  • Haskell
    a127423 n = a127423_list !! (n-1)
    a127423_list = 1 : map read (zipWith (++) (tail iss) iss) :: [Integer]
                       where iss = map show [1..]
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [Seqint(Intseq(n) cat Intseq(n+1)): n in [0..50]]; // Vincenzo Librandi, Nov 08 2016
    
  • Maple
    c2:=proc(x,y) local s: s:=proc(m) nops(convert(m,base,10)) end: x*10^s(y)+y: end: seq(c2(n,n-1),n=1..53); # Emeric Deutsch, Mar 07 2007
  • Mathematica
    Join[{1}, nxt[n_] := Module[{idn = IntegerDigits[n + 1], idn1 = IntegerDigits[n]}, FromDigits[Join[idn, idn1]]]; Array[nxt, 70]] (* Vincenzo Librandi, Nov 08 2016 *)
    nxt[{n_, a_}] := {n + 1, (n + 1) * 10^IntegerLength[n] + n}; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Jan 04 2019 *)
  • PARI
    a(n) = if (n==1, 1, eval(Str(n, n-1))); \\ Michel Marcus, Oct 14 2016
    
  • Scala
    val numerStrs = (1 to 50).map(Integer.toString(_)).toList
    val concats = (numerStrs.drop(1)) zip (numerStrs.dropRight(1))
    concats.map(x => Integer.parseInt(x.1 + x._2)) // _Alonso del Arte, Oct 24 2019

Extensions

More terms from Emeric Deutsch, Mar 07 2007

A154530 Primes that are a concatenation of 2*k and 2*k+1 or 2*k and 2*k-1 for some k.

Original entry on oeis.org

23, 43, 67, 89, 109, 1213, 2221, 2423, 3433, 3637, 4241, 4243, 5051, 5657, 5857, 6263, 6869, 7069, 7877, 7879, 8081, 8887, 9091, 9293, 9697, 10099, 102101, 102103, 108107, 108109, 112111, 114113, 120121, 124123, 126127, 138139, 148147, 150151
Offset: 1

Views

Author

Pierre CAMI, Jan 11 2009

Keywords

Examples

			2*1=2, 2*1+1=3, and 23 the concatenation of 2 and 3 is prime, so a(1)=23
		

Crossrefs

Cf. A010051, subsequence of A248378.

Programs

  • Haskell
    a154530 n = a154530_list !! (n-1)
    a154530_list = filter ((== 1) . a010051') a248378_list
    -- Reinhard Zumkeller, Jun 27 2015

Extensions

Edited by Charles R Greathouse IV, Apr 28 2010

A371144 The smallest number such that the concatenation of n, a(n), n+1 is divisible by the concatenation of n and n+1.

Original entry on oeis.org

3, 5, 7, 0, 37, 76, 48, 98, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 560, 571, 582, 593, 604, 615, 626, 637, 648, 361, 670, 681, 692, 703, 714, 725, 736, 747, 758, 769, 780
Offset: 1

Views

Author

Scott R. Shannon, Mar 12 2024

Keywords

Comments

For n > 10, when n starts with the digits 1, 2, 3, or 4, then a(n) = 2*n + 1. When n starts with the digits 5, 6, 7, or 8, then a(n) = 11*n + 10 for the vast majority of terms, although some outliers exist e.g., a(749) = 2251. When n starts with the digit 9, the values are somewhat more varied.
The maximum possible value for any term is the concatenation of n+1 and n, see the example for a(6) below. However except for a(6) and a(8), for the terms studied this only occurs four times for every order of magnitude increase in n, namely the four numbers consisting of all 9's except for the final digit of 0, 2, 6, or 8.
The first duplicate term is a(5) = a(18) = 37. There are 234 duplicates in the first 10000 terms.

Examples

			a(1) != 1 as "1"+"1"+"2" = 112 is not divisible by "1"+"2" = 12.
a(1) != 2 as "1"+"1"+"2" = 122 is not divisible by "1"+"2" = 12.
a(1) = 3 as "1"+"3"+"2" = 132 is divisible by "1"+"2" = 12.
a(5) = 37 as "5"+"37"+"6" = 5376 is divisible by "5"+"6" = 56.
a(6) = 76 as "6"+"76"+"7" = 6767 is divisible by "6"+"7" = 67. This is the first time the maximum possible value is required.
		

Crossrefs

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