A362108 Index of 2^k in A350877, where k = A362107(n).
1, 5, 9, 16, 731, 513152096
Offset: 1
Examples
Terms 730-742 in A350877 are 505, 2^11, 2^10,..., 8, 4, 2, 1, corresponding to A362107(5) = 11 and a(5) = 731.
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.
Terms 730-742 in A350877 are 505, 2^11, 2^10,..., 8, 4, 2, 1, corresponding to A362107(5) = 11 and a(5) = 731.
S = 1, ... 1 is odd, we add the prime 2: S = 1, 3, ... 3 is odd, we add the next prime, 3: S = 1, 3, 6, ... 6 is even, we divide by 2: S = 1, 3, 6, 3, ... 3 is odd, we add the next prime, 5: S = 1, 3, 6, 3, 8, ... 8 is even we divide by 2 (etc.): S = 1, 3, 6, 3, 8, 4, 2, 1, ... 1 is odd, we add the next prime, 7: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, ... 8 is even, we divide by 2 (etc.): S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, ... 1 is odd, we add the next prime, 11: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, ... 12 is even, we divide by 2 (etc.): S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, ... 3 is odd, we add the next prime, 13: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, ... 16 is even, we divide by 2 (etc.): S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, ... 1 is odd, we add the next prime, 17: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, ... 18 is even, we divide by 2: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, 9, ... 9 is odd, we add the next prime, 19: S = 1, 3, 6, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 16, 8, 4, 2, 1, 18, 9, 28, ... Etc.
# To produce M terms in b-file format: M:=100000; p:=1; L:=1; for n from 1 to M do if n=1 then lprint(n,L); else if (L mod 2) = 0 then L := L/2; else p:=nextprime(p); L:=L+p; fi; lprint(n,L); fi; od: # N. J. A. Sloane, Jan 28 2022
j = 1; q = 2; {j}~Join~Reap[Do[If[EvenQ[j], k = j/2, k = j + q; Set[q, NextPrime[q]]]; Sow[k]; j = k, {i, 79}]][[-1, -1]] (* Michael De Vlieger, Jan 22 2022 *) nxt[{sp_,n_,a_}]:=Module[{p=2,c},c=If[EvenQ[a],a/2,a+sp];{If[EvenQ[ a],sp,NextPrime[sp]],n+1,c}]; NestList[nxt,{2,1,1},80][[All,3]] (* Harvey P. Dale, Jan 23 2022 *)
{ print1 (v=1); forprime (p=2, 109, print1 (", "v+=p); while (v%2==0, print1 (", "v/=2))) } \\ Rémy Sigrist, Jan 23 2022
A350877_first(N,p=0)=vector(N,i,N=if(!p,p=1,N%2,N+p=nextprime(p+1),N/2)) \\ M. F. Hasler, Jan 23 2022
from sympy import nextprime a, p = [1], 1 [a.append(a[-1]//2 if a[-1]%2 == 0 else a[-1]+(p:=nextprime(p))) for n in range(79)] print(a) # Michael S. Branicky, Jan 23 2022
The 1 at 513152128 is a down-drop from 2^32 at index 513152096 in A350877, 2^32 being 712032365 at index 513152095 plus the prime 3582934931.
Comments