A367360 Comma transform of squares.
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
Examples
The squares are 0, 1, 4, 9, 16, 25, ..., so the comma transform is [0]1, 14, 49, 91, 62, ...
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..10000
Crossrefs
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
Comments