login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 8
1, 4, 8, 6, 12, 14, 16, 9, 18, 20, 24, 26, 28, 22, 39, 15, 36, 35, 40, 38, 57, 34, 48, 49, 51, 44, 46, 33, 60, 77, 64, 32, 75, 56, 81, 68, 76, 58, 100, 55, 84, 111, 88, 62, 125, 70, 96, 91, 98, 95, 134, 72, 108, 82, 141, 80, 140, 92, 120, 156, 124, 94, 121, 52, 152, 145 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Sequence is prime-free.
LINKS
K. Strassburger, Plot of shotgun numbers
EXAMPLE
B(1) = 1,2,3,4,5,6,7,8, 9,10,11,12,13,14,...
B(2) = 1,4,3,2,5,8,7,6, 9,12,11,10,13,16,...
B(3) = 1,4,8,2,5,3,7,6,10,12,11, 9,13,16,...
B(4) = 1,4,8,6,5,3,7,2,10,12,11,14,13,16,...
MATHEMATICA
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 *)
PROG
(SageMath)
def divsign(s, k):
if not k.divides(s): return 0
return (-1)^(s//k)*k
def A064494(n):
s = n
for k in srange(n, 1, -1):
s -= divsign(s, k)
return s
print([A064494(n) for n in (1..66)]) # Peter Luschny, Sep 16 2019
CROSSREFS
Sequence in context: A328278 A288189 A335159 * A119800 A330685 A063723
KEYWORD
nice,nonn
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 16 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 23:11 EDT 2024. Contains 374360 sequences. (Running on oeis4.)