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

A367360 Comma transform of squares.

Original entry on oeis.org

1, 14, 49, 91, 62, 53, 64, 96, 48, 11, 1, 11, 41, 91, 62, 52, 62, 93, 43, 14, 4, 14, 45, 95, 66, 56, 67, 97, 48, 19, 9, 11, 41, 91, 61, 51, 61, 91, 41, 11, 1, 11, 41, 91, 62, 52, 62, 92, 42, 12, 2, 12, 42, 92, 63, 53, 63, 93, 43, 13, 3, 13, 43, 94, 64, 54, 64, 94, 44, 14, 5, 15, 45, 95, 65, 55, 65, 96, 46, 16, 6, 16, 46, 97
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

To compute the comma transform of a sequence [b,c,d,e,f,...], concatenate the last digit of each term with the first digit of the following term. In other words, these are the numbers formed by the pairs of digits that surround the commas that separate the terms of the original sequence.
The comma transform CT(S) of a sequence S of positive numbers maps S into the set F consisting of finite or infinite sequences of positive numbers each with one or two digits. The inverse comma transform CTi maps an element of F to an element of F.
Inspired by Eric Angelini's A121805.

Examples

			The squares are 0, 1, 4, 9, 16, 25, ..., so the comma transform is [0]1, 14, 49, 91, 62, ...
		

Crossrefs

A166499 is the comma transform of the primes, A367361 of the powers of 2, A367362 of the nonnegative integers. See also A368362.

Programs

  • Maple
    Maple code for comma transform (CT(a)) of a sequence a:
    # leading digit, from A000030
    Ldigit:=proc(n) local v; v:=convert(n, base, 10); v[-1]; end;
    CT:=proc(a) local b,i; b:=[];
    for i from 1 to nops(a)-1 do
    b := [op(b), 10*(a[i] mod 10) + Ldigit(a[i+1])]; od: b; end;
    # Inverse comma transform of sequence A calculated in base "bas": - N. J. A. Sloane, Jan 03 2024
    bas := 10;
    Ldigit:=proc(n) local v; v:=convert(n, base, bas); v[-1]; end;
    CTi := proc(A) local B,i,L,R;
    for i from 1 to nops(A) do
       if A[i]>=bas^2 then error("all terms must have 1 or 2 digits"); fi; od:
    B:=Array(1..nops(A),-1);
    if A[1] >= bas then B[1]:= Ldigit(A[1]); L:=(A[1] mod bas);
    else B[1]:=10; L:=A[1];
    fi;
    for i from 2 to nops(A) do
      if A[i] >= bas then R := Ldigit(A[i]) else R:=0; fi;
      B[i] := L*bas + R;
      L := (A[i] mod bas);
    od;
    B;
    end;
    # second Maple program:
    a:= n-> parse(cat(""||(n^2)[-1],""||((n+1)^2)[1])):
    seq(a(n), n=0..99);  # Alois P. Heinz, Nov 22 2023
  • Mathematica
    a[n_]:=FromDigits[{Last[IntegerDigits[n^2]],First[IntegerDigits[(n+1)^2]]}];
    a/@Range[0,83] (* Ivan N. Ianakiev, Nov 24 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(i**2) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 84))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367360(n): return (0, 10, 40, 90, 60, 50, 60, 90, 40, 10)[n%10]+int(str((n+1)**2)[0]) # Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A008959(n) + A002993(n+1). - Alois P. Heinz, Nov 22 2023

A367362 Comma transform of the nonnegative integers.

Original entry on oeis.org

1, 12, 23, 34, 45, 56, 67, 78, 89, 91, 1, 11, 21, 31, 41, 51, 61, 71, 81, 92, 2, 12, 22, 32, 42, 52, 62, 72, 82, 93, 3, 13, 23, 33, 43, 53, 63, 73, 83, 94, 4, 14, 24, 34, 44, 54, 64, 74, 84, 95, 5, 15, 25, 35, 45, 55, 65, 75, 85, 96, 6, 16, 26, 36, 46, 56, 66, 76, 86, 97, 7, 17, 27, 37, 47, 57, 67, 77, 87, 98, 8, 18
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(""||n[-1], ""||(n+1)[1])):
    seq(a(n), n=0..99);  # Alois P. Heinz, Nov 22 2023
  • Mathematica
    FromDigits /@ Partition[Rest@ Flatten[{First[#], Last[#]} & /@ IntegerDigits[Range[0, 120]]], 2, 2] (* Michael De Vlieger, Nov 22 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(i) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 82))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367362(n): return (n%10)*10+int(str(n+1)[0]) # Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A010879(n) + A000030(n+1). - Alois P. Heinz, Nov 22 2023

A367361 Comma transform of powers of 2.

Original entry on oeis.org

12, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 22, 45, 81, 62, 24, 49, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 23, 46, 81
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Partition[Rest@ Flatten[{First[#], Last[#]} & /@ IntegerDigits[2^Range[0, 120]]], 2, 2] (* Michael De Vlieger, Nov 22 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(2**i) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367361(n): return (60,20,40,80)[n&3]+int(str(1<Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A000689(n) + A008952(n+1). - Alois P. Heinz, Nov 22 2023

A086104 Primes appearing as concatenation of the last digit of Prime[A086101(n)] and the first digit of Prime[A086101(n)+1].

Original entry on oeis.org

23, 71, 11, 31, 71, 13, 17, 37, 71, 11, 31, 71, 31, 71, 11, 71, 11, 71, 31, 71, 31, 11, 11, 31, 71, 73, 13, 73, 13, 73, 73, 73, 17, 17, 97, 97, 37, 97, 37, 17, 17, 97, 37, 79, 79, 19, 79, 19, 79, 79, 19, 79, 19, 71, 31, 11, 11, 31, 11, 11, 31, 71, 11, 31, 71, 31, 71, 31, 11
Offset: 1

Views

Author

Zak Seidov, Jul 09 2003

Keywords

Comments

Prime numbers in A166499. - Zak Seidov, Oct 15 2009

Crossrefs

Cf. A086101.

Programs

  • Mathematica
    Select[Table[FromDigits[{IntegerDigits[Prime[n]][[-1]],IntegerDigits[Prime[n+1]][[1]]}], {n,300}],PrimeQ] (* Zak Seidov, Oct 15 2009 *)
Showing 1-4 of 4 results.