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.

A064494 Shotgun (or Schrotschuss) numbers: limit of the recursion B(k) =T[k](B(k-1)), where B(1) = (1,2,3,4,5,...) and T[k] is the Transformation that permutes the entries k(2i-1) and k(2i) for all positive integers i.

This page as a plain text file.
%I A064494 #9 Sep 16 2019 06:38:57
%S A064494 1,4,8,6,12,14,16,9,18,20,24,26,28,22,39,15,36,35,40,38,57,34,48,49,
%T A064494 51,44,46,33,60,77,64,32,75,56,81,68,76,58,100,55,84,111,88,62,125,70,
%U A064494 96,91,98,95,134,72,108,82,141,80,140,92,120,156,124,94,121,52,152,145
%N A064494 Shotgun (or Schrotschuss) numbers: limit of the recursion B(k) =T[k](B(k-1)), where B(1) = (1,2,3,4,5,...) and T[k] is the Transformation that permutes the entries k(2i-1) and k(2i) for all positive integers i.
%C A064494 Sequence is prime-free.
%H A064494 K. Strassburger, <a href="/A064494/a064494.jpg">Plot of shotgun numbers</a>
%e A064494 B(1) = 1,2,3,4,5,6,7,8, 9,10,11,12,13,14,...
%e A064494 B(2) = 1,4,3,2,5,8,7,6, 9,12,11,10,13,16,...
%e A064494 B(3) = 1,4,8,2,5,3,7,6,10,12,11, 9,13,16,...
%e A064494 B(4) = 1,4,8,6,5,3,7,2,10,12,11,14,13,16,...
%t A064494 max = 66; b[1, j_] := j; b[k_, j_] := b[k, j] = b[k-1, j]; Do[b[k, 2j*k-k] = b[k-1, 2j*k]; b[k, 2j*k] = b[k-1, 2j*k-k], {k, 2, max}, {j, 1, max}]; a[n_] := b[max, n]; Table[a[n], {n, 1, max}] (* _Jean-François Alcover_, Oct 11 2012 *)
%o A064494 (SageMath)
%o A064494 def divsign(s, k):
%o A064494     if not k.divides(s): return 0
%o A064494     return (-1)^(s//k)*k
%o A064494 def A064494(n):
%o A064494     s = n
%o A064494     for k in srange(n, 1, -1):
%o A064494         s -= divsign(s, k)
%o A064494     return s
%o A064494 print([A064494(n) for n in (1..66)]) # _Peter Luschny_, Sep 16 2019
%Y A064494 Cf. A064728, A064590, A064627.
%K A064494 nice,nonn
%O A064494 1,2
%A A064494 Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 16 2001