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.

Previous Showing 11-16 of 16 results.

A281254 Concatenate the decimal numbers n n-2 n-4 ...5 3 1 2 4 ... n-5 n-3 n-1 if n is odd, or n n-2 n-4 ... 6 4 2 1 3 5 ... n-5 n-3 n-1 if n is even.

Original entry on oeis.org

1, 21, 312, 4213, 53124, 642135, 7531246, 86421357, 975312468, 10864213579, 1197531246810, 121086421357911, 13119753124681012, 1412108642135791113, 151311975312468101214, 16141210864213579111315, 1715131197531246810121416
Offset: 1

Views

Author

Robert G. Wilson v, Jan 18 2017

Keywords

Comments

The old name was "Alternately concatenate the decimal digits from back to front 1...n such that n is always to the left.".
a(40714), with 192464 decimal digits, is the sequence's first (probable) prime. - Hans Havermann, Dec 17 2019
The terms at even indices are the same as the even-indexed terms of A053063. - Hans Havermann, Jan 16 2020

Examples

			a(13) = 13119753124681012.
		

Crossrefs

See A053063 for another version.

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n=1, 1, parse(cat(a(n-1), n))) end:
    a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(n, b(n-1)))) end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Jan 18 2017
  • Mathematica
    f[n_] := Fold[ If[ Mod[n +#2, 2] == 0, #2, #1]*10^IntegerLength@ If[ Mod[n +#2, 2] == 0, #1, #2] +If[ Mod[n +#2, 2] == 1, #2, #1] &, 0, Range@ n]; Array[f, 17]
  • Python
    def a(n):
        if n==1:
            return ["1"]
        return [str(n)]+a(n-1)[::-1]
    def A281254(n):
        return "".join(a(n)) # Indranil Ghosh, Jan 23 2017

Extensions

Edited by N. J. A. Sloane, Dec 07 2019

A061963 Numbers n such that n divides the (left) concatenation of all numbers <= n written in base 10 (most significant digit on right).

Original entry on oeis.org

1, 3, 9, 189, 753, 987, 6739, 10953, 51963, 171897, 224081, 635031, 1135001, 4437459
Offset: 1

Views

Author

Larry Reeves (larryr(AT)acm.org), May 24 2001

Keywords

Comments

This sequence differs from A029527 in that all least significant zeros are kept during concatenation.
Left concatenation, reverse order (i.e., digit-wise reversal of the concatenation 123...n), as in A138793.
No more terms < 10^7.
All terms must be odd.

Examples

			n = 13 is not a term since 31211101987654321 is not divisible by 13. (Note that the order of the digits of 13, 12 and 10 is reversed.)
See A061955 for further examples.
		

Crossrefs

Programs

  • Mathematica
    k = 2; lst = {}; rid = 1; While[k < 1001, exp = Floor[ Log10[rid]] + 1 + If[Mod[k, 10] == 1, IntegerExponent[k - 1, 10], 0]; rid = rid + FromDigits@ Reverse@ IntegerDigits@ k*(10^exp); If[ Mod[rid, k] == 0, Print@ k; AppendTo[lst,k]]; k++]; lst (* and to test any single value n *) fQ[n_] := Mod[ FromDigits@ Reverse@ Flatten@ IntegerDigits@ Range@ n, n] == 0 (* Robert G. Wilson v, Sep 12 2011 *)
    Select[Range[5*10^6],Divisible[FromDigits[Reverse[Flatten[ IntegerDigits/@ Range[ #]]]], #]&] (* Harvey P. Dale, Apr 10 2017 *)
  • PARI
    isok(n) = my(s = ""); forstep (k=n, 1, -1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); (eval(s) % n) == 0; \\ Michel Marcus, Jan 28 2017

Extensions

Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
a(12)-a(14) from Lars Blomberg, Aug 19 2011

A281066 Concatenation R(n)R(n-1)R(n-2)...R(2)R(1) read mod n, where R(x) is the digit-reversal of x (with leading zeros not omitted).

Original entry on oeis.org

0, 1, 0, 1, 1, 3, 3, 1, 0, 1, 4, 9, 5, 7, 6, 1, 6, 9, 17, 1, 15, 15, 19, 9, 21, 1, 18, 13, 28, 21, 26, 17, 15, 3, 16, 9, 30, 3, 15, 1, 1, 33, 10, 37, 36, 43, 22, 33, 19, 21, 48, 45, 2, 45, 26, 49, 27, 33, 33, 21, 48, 25, 36, 49, 36, 15, 22, 5, 27, 11, 42, 9, 2, 73, 21, 17, 59, 57, 5, 1
Offset: 1

Views

Author

Robert G. Wilson v, Jan 14 2017

Keywords

Examples

			a(13) = 31211101987654321 (mod 13) = 5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[ FromDigits@ Fold[ Join[ Reverse@ IntegerDigits@#2, #1] &, {}, Range@ n], n]; Array[f, 80]
  • PARI
    a(n) = my(s = ""); forstep (k=n,1,-1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); eval(s) % n; \\ Michel Marcus, Jan 28 2017
  • Python
    def A281066(n):
        s=""
        for i in range(n, 0, -1):
            s+=str(i)[::-1]
        return int(s)%n # Indranil Ghosh, Jan 28 2017
    

Formula

a(n) = A138793(n) (mod n).

A281253 Alternately concatenate the decimal digits from front to back 1...n such that n is always to the right.

Original entry on oeis.org

1, 12, 213, 3124, 42135, 531246, 6421357, 75312468, 864213579, 97531246810, 1086421357911, 119753124681012, 12108642135791113, 1311975312468101214, 141210864213579111315, 15131197531246810121416, 1614121086421357911131517
Offset: 1

Views

Author

Robert G. Wilson v, Jan 18 2017

Keywords

Comments

a(n) is prime for n: 121, 1399 and no others < 3000.

Examples

			a(13) = 12108642135791113.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n=1, 1, parse(cat(n, a(n-1)))) end:
    a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(b(n-1), n))) end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Jan 18 2017
  • Mathematica
    f[n_] := Fold[ If[ Mod[n +#2, 2] == 0, #1, #2]*10^IntegerLength@ If[ Mod[n +#2, 2] == 0, #2, #1] +If[ Mod[n +#2, 2] == 0, #2, #1] &, 0, Range@ n]; Array[f, 17]
  • Python
    def a(n):
        if n==1:
            return ["1"]
        return a(n-1)[::-1]+[str(n)]
    def A281253(n):
        return "".join(a(n)) # Indranil Ghosh, Jan 27 2017

A261138 The concatenation of 123456...n and the reverse of this number.

Original entry on oeis.org

11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891001987654321, 12345678910111101987654321, 123456789101112211101987654321, 1234567891011121331211101987654321, 12345678910111213144131211101987654321
Offset: 1

Views

Author

Umut Uludag, Aug 10 2015

Keywords

Comments

Let R(n) denote the number obtained by formally reversing the digits of n, including any leading zeros that may appear; a(n) is the decimal concatenation of 1,2,...,n,R(n),R(n-1),...,R(3),R(2),R(1). - N. J. A. Sloane, Dec 01 2021
A palindromic version of A173426.
Has same start as A259937, but A259937 generates non-palindromic terms for n>9.
All terms are multiples of 11 (cf. A349805).

Examples

			For n=10 we concatenate 1,2,3,...,10,01,9,8,...3,2,1 getting 1234567891001987654321.
		

Crossrefs

Programs

  • Maple
    with(StringTools);
    myReverse := n -> Reverse(convert(n,string));
    A349804:=proc(n) local i,L,R;
    L:=""; R:="";
    for i from n to 1 by -1 do
    L:=Join( [convert(i,string), L],"");
    R:=Join( [R, myReverse(convert(i,string))],"");
    od:
    parse(Join([L,R],""));
    end proc; # N. J. A. Sloane, Dec 01 2021
    # second Maple program:
    a:= n-> (s-> parse(cat(s, seq(s[-i], i=1..length(s)))))(cat("", $1..n)):
    seq(a(n), n=1..14); # Alois P. Heinz, Dec 01 2021
  • Mathematica
    Table[d = Flatten[IntegerDigits /@ Range@ n]; FromDigits@ Flatten[{d, Reverse@ d}], {n, 13}] (* Michael De Vlieger, Aug 20 2015 *)
  • Python
    def A349804(n): return int((lambda x: x+x[::-1])(''.join(str(d) for d in range(1,n+1)))) # Chai Wah Wu, Dec 01 2021

Formula

a(n) = concatenate( A007908(n), A138793(n) retaining leading zeros).

Extensions

More than the usual number of terms are shown in order to distinguish this from several similar sequences.
Edited by N. J. A. Sloane, Dec 11 2021

A078998 Choose a(n) so that a(1)+a(2)+...+a(n) = concatenation of n first natural numbers.

Original entry on oeis.org

1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 12222222121, 1222222212101, 122222221210101, 12222222121010101, 1222222212101010101, 122222221210101010101, 12222222121010101010101
Offset: 1

Views

Author

Benoit Cloitre, Jan 12 2003

Keywords

Crossrefs

Programs

  • Mathematica
    b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 30}]; c = {}; Do[AppendTo[c, b[[n + 1]] - b[[n]]], {n, 1, Length[b] - 1}]; c (* Artur Jasinski, Mar 30 2008 *)

Formula

a(1)=1; for n>1, a(n) = A007908(n)-A007908(n-1)
Previous Showing 11-16 of 16 results.