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

A303767 May code of n: a(0) = 0, and for n > 0, if n = 2^k, a(n) = n + a(n-1), otherwise, when n = 2^k + r (with 0 < r < 2^k), then a(n) = 2^k + a(r-1); see comments for equivalent alternative descriptions.

Original entry on oeis.org

0, 1, 3, 2, 6, 4, 5, 7, 15, 8, 9, 11, 10, 14, 12, 13, 29, 16, 17, 19, 18, 22, 20, 21, 23, 31, 24, 25, 27, 26, 30, 28, 60, 32, 33, 35, 34, 38, 36, 37, 39, 47, 40, 41, 43, 42, 46, 44, 45, 61, 48, 49, 51, 50, 54, 52, 53, 55, 63, 56, 57, 59, 58, 62, 126, 64, 65, 67, 66, 70, 68, 69, 71, 79, 72, 73, 75, 74, 78, 76, 77, 93, 80, 81
Offset: 0

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

This is also "minimal subset/superset bitmask" transform of the nonnegative integers, A001477. In that transform, applicable to any N -> N injection f, we start from a(0) = 0, after which for n > 0, if there are one or more k_i that are not already present in the sequence among terms a(0) .. a(n-1), and for which bitor(k_i,a(n-1)) = a(n-1), then a(n) = that k_i for which f(k_i) is minimized; otherwise, a(n) = that h_i for which f(h_i) is minimized among the infinite set of numbers h_i for which bitand(h_i,a(n-1)) = a(n-1) and that are not yet present in the sequence. In this case f(n) = A001477(n) = n.
The original, equivalent definition is:
a(0) = 0 and for n > 0, if there are one or more k_i that are not already present in the sequence among terms a(0) .. a(n-1), and for which bitor(k_i,a(n-1)) = a(n-1), then a(n) = that k_i which gives minimum value of A019565(k_i) amongst them; otherwise, when no such k_i exists, a(n) = the least number not already present that can be obtained by toggling a single 0-bit of a(n-1) to 1. This is done by trying to toggle successive vacant bits from the least significant end of the binary representation of a(n-1), until such a sum a(n-1) + 2^h (= a(n-1) bitxor 2^h) is found that is not already present in the sequence.
Shares with permutations like A003188, A006068, A300838, A302846, A303765 and A304083 the property that when moving from any a(n) to a(n+1) either a subset of 0-bits are toggled on (changed to 1's), or a subset of 1-bits are toggled off (changed to 0's), but no both kind of changes may occur at the same step.
Also, like A003188, A006068 and many other base-2 representation related permutations, this permutation preserves the binary size of n (A000523(n)), and furthermore, a(n) seems to stay at most points (except at powers of 2) remarkably close to n.
From Antti Karttunen, May 23 2018: (Start)
Outline of the proof that the definition involving A019565 is equivalent to the recurrent formula:
Even though A019565 is nonmonotonic, for example A019565(4) = 5 = p_3 < A019565(3) = 6 = p_1 * p_2, and in general, although there are always primes p_k < p_{i1} * p_{i2} * ... * p_{ih}, with i1, i2, ..., ih < k, it doesn't matter here, because not just the position of the most significant 1-bit is monotonic in this sequence (see the binary representation at A304747), but also in each subrange (2^k)+2 .. (2^(k+1))-1 the position of the second most significant 1-bit moves only leftward, i.e., is monotonic, which follows from the recursive formula.
To see this, consider the first time in this sequence when in a batch of terms (of equal binary width) we have bits in position k (the most significant position) and (k-1) on (that is, both are 1's), the latter corresponding to prime p_k: while in principle a bit-based rule could choose to subtract 2^(k-1), in preference to any 1-bits to the right of it (that correspond to primes p_{i1} .. p_{ih}), it cannot do so at this stage, because it is the second most significant 1-bit, and then it would not move only leftward, contradicting what was said above. Neither this can occur later when more 1-bits have appeared to their left: the recursive formula guarantees it.
Also conversely, even though p_4 = 7 > 6 = p_1 * p_2, and in general, we always have such prime p_k > p_{i1} * p_{i2} * ... * p_{ih}, with i1, i2, ..., ih < k, and while here A019565-based rule (see comments in A303760) would prefer dividing p_k out instead of any subset of p_{i1} .. p_{ih}, it happens that in that rule, the index of the largest prime (A061395) grows monotonically, so at the stage where p_k is the largest prime of the batch of length 2^(k-1), p_k just cannot be divided out, and also here the structure of the later batches is strictly determined by recursion.
(End)

Examples

			From _Michael De Vlieger_, May 23 2018: (Start)
Table below shows the initial 17 terms at right. First column is index n,
second shows "." if A303760(n) = largest divisor of A303760(n-1), or factor p.
   n     p\d  m=A303760(n)  A054841(m)    a(n)
  -------------------------------------------
   0       .        1               0       0
   1       2        2               1       1
   2       3        6              11       3
   3       .        3              10       2
   4       5       15             110       6
   5       .        5             100       4
   6       2       10             101       5
   7       3       30             111       7
   8       7      210            1111      15
   9       .        7            1000       8
  10       2       14            1001       9
  11       3       42            1011      11
  12       .       21            1010      10
  13       5      105            1110      14
  14       .       35            1100      12
  15       2       70            1101      13
  16      11      770           11101      29
  ...  (End)
		

Crossrefs

Cf. A303768 (inverse), A304747 (terms shown in base-2).
Cf. also A303763, A303765, A303769, A303775, A304083 (similar sequences).

Programs

  • Mathematica
    Map[FromDigits[#, 2] &@ Reverse@ If[# == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ #] &@# &, Nest[Append[#, Block[{d = Divisors@ #[[-1]], p = 2}, If[Complement[d, #] != {}, Complement[d, #][[1]], While[Nand[Mod[#[[-1]], p] != 0, FreeQ[#, p #[[-1]] ] ], p = NextPrime@ p]; p #[[-1]] ] ] ] &, {1}, 83]] (* Michael De Vlieger, May 23 2018 *)
  • PARI
    A209229(n) = (n && !bitand(n,n-1));
    A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644
    A303767(n) = if(!n,n,if(A209229(n),n+A303767(n-1),A053644(n)+A303767(n-A053644(n)-1))); \\ Program based on new recurrence added May 06 2018
    
  • PARI
    up_to = (2^7)-1;
    A006519(n) = (2^valuation(n, 2));
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ From A019565
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    v303767 = vector(up_to);
    m303768 = Map();
    w=1; for(n=1,up_to,s = Set([]); for(m=1,w, if((bitor(w,m)==w) && !mapisdefined(m303768,m), s = setunion(Set([A019565(m)]),s))); if(length(s)>0, w = A048675(vecmin(s)), b=A006519(1+w); while(bitand(w,b) || mapisdefined(m303768,w+b), b <<= 1); w += b); v303767[n] = w; mapput(m303768,w,n));
    A303767(n) = if(!n,n,v303767[n]);
    A303768(n) = if(!n,n,mapget(m303768,n));

Formula

a(0) = 0, and for n > 0, if n = 2^k, a(n) = n + a(n-1), otherwise, when n = 2^k + r (with 0 < r < 2^k), then a(n) = 2^k + a(r-1). \\ Antti Karttunen, May 06 2018
a(n) = A048675(A303760(n)).
a(n) = A052331(A303771(n)).
For all n >= 1, A000523(a(n)) = A000523(n), A007088(a(n)) = A304747(n).

Extensions

Name replaced with an equivalent, but simpler definition by Antti Karttunen, May 06 2018

A303771 Divisor-or-multiple permutation of natural numbers, "Fermi-Dirac piano played with May code": a(n) = A052330(A303767(n)).

Original entry on oeis.org

1, 2, 6, 3, 12, 4, 8, 24, 120, 5, 10, 30, 15, 60, 20, 40, 280, 7, 14, 42, 21, 84, 28, 56, 168, 840, 35, 70, 210, 105, 420, 140, 1260, 9, 18, 54, 27, 108, 36, 72, 216, 1080, 45, 90, 270, 135, 540, 180, 360, 2520, 63, 126, 378, 189, 756, 252, 504, 1512, 7560, 315, 630, 1890, 945, 3780, 41580, 11, 22, 66, 33, 132, 44, 88, 264, 1320, 55, 110, 330, 165, 660, 220
Offset: 0

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

Consider A019565. Imagine that it is an automatic piano that "plays sequences" when an appropriate punched "tape" is fed to it (as its input), i.e., when it is composed from the right with an appropriate sequence p, as A019565(p(n)). The 1-bits in the binary expansion of each p(n) are the "holes" in the tape, and they determine which "tunes" are present on beat n. The "tunes" are actually primes that are multiplied together. Of course only "squarefree music" (sequences containing only squarefree numbers, A005117) is possible to generate this way, thus we call A019565 a "squarefree piano".
There is a more sophisticated instrument, called "Fermi-Dirac piano" (A052330), with which it is possible to produce sequences that may contain any numbers.
If the tape is constructed in such a way that between the successive beats (when moving from p(n) to p(n+1)), either a subset of 0-bits are toggled on (changed to 1's), or a subset of 1-bits are toggled off (changed to 0's), but no both kind of changes occur simultaneously, then when fed as an input to either of these pianos, the resulting sequence "s" (the output) is guaranteed to satisfy the condition that s(n+1) is either a multiple or a divisor of s(n). For example, Gray code A003188 and its inverse A006068 are examples of such tapes, and they produce sequences A302033, A207901 and A284003, A302783.
This divisor-or-multiple permutation is obtained by playing "Fermi-Dirac piano" with the same tape which yields A303760 when "squarefree piano" is played with it. Note that A303760 is not a subsequence of this sequence, as its terms occur in different order than the squarefree terms here.
See also Peter Munn's Apr 11 2018 message on SeqFan-mailing list and comments in A304537.

Crossrefs

Cf. A303772 (inverse).
Cf. also A064736, A113552, A207901, A281978, A282291, A302350, A302781, A302783, A303751, A304085, A304531 for similar permutations.

Programs

  • PARI
    default(parisizemax,2^31);
    up_to_e = 16;
    up_to = (1 + 2^up_to_e);
    v050376 = vector(2+up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == 2+up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
    v303760 = vector(up_to);
    m_inverses = Map();
    prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,d),v303760[n] = d;mapput(m_inverses,d,n);break)); if(!v303760[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303760[n] = try; mapput(m_inverses,try,n)); prev = v303760[n]);
    A303760(n) = v303760[n+1];
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A303771(n) = A052330(A048675(A303760(n)));

Formula

a(n) = A052330(A303767(n)) = A052330(A048675(A303760(n))). [See comments].

Extensions

Name amended by Antti Karttunen, May 16 2018

A303761 Divisor-or-multiple permutation of squarefree numbers: a(0) = 1, and for n >= 1, a(n) is either the least divisor of a(n-1) not already present, or (if all divisors already used), a(n) is obtained by iterating the map x -> x*A053669(x), starting from x = a(n-1), until x is found which is not already present in the sequence.

Original entry on oeis.org

1, 2, 6, 3, 30, 5, 10, 210, 7, 14, 42, 21, 2310, 11, 22, 66, 33, 330, 15, 30030, 13, 26, 78, 39, 390, 65, 130, 2730, 35, 70, 510510, 17, 34, 102, 51, 510, 85, 170, 3570, 105, 9699690, 19, 38, 114, 57, 570, 95, 190, 3990, 133, 266, 798, 399, 43890, 55, 110, 223092870, 23, 46, 138, 69, 690, 115, 230, 4830, 161, 322, 966, 483, 53130, 77
Offset: 0

Views

Author

Antti Karttunen, May 02 2018

Keywords

Comments

Each a(n+1) is either a divisor or a multiple of a(n).
The primorials (A002110) occur in ascending order, in positions given by A300829, and each is then followed by the least unused term up to that point. For n = 2 .. 79 this is the highest prime factor of the said primorial, but note that for A300829(80) = 4965, a(4965) = A002110(80), but a(4966) = 407 = 11*37, instead of prime(80) = 409. Note that 409 occurs at a(5043), where 5043 = 1+A300829(81).
For example, 11 comes after a(A300829(5)) = a(12) = 2310 = 2*3*5*7*11, and all squarefree numbers < 11: {1, 2, 3, 5, 6, 7, 10} occur before a(13).

Crossrefs

Cf. A005117, A019565, A053669, A300829 (gives the positions of records), A303765.
Cf. also A303751, A303760, A303762.

Programs

  • PARI
    default(parisizemax,2^31);
    up_to = 2^8;
    A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
    v303761 = vector(up_to);
    m_inverses = Map();
    prev=1;for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,d),v303761[n] = d;mapput(m_inverses,d,n);break)); if(!v303761[n], while(mapisdefined(m_inverses,prev), prev *= A053669(prev)); v303761[n] = prev; mapput(m_inverses,prev,n)); prev = v303761[n]);
    A303761(n) = v303761[n+1];

Formula

a(n) = A019565(A303765(n)).
For n >= 0, a(A300829(n)) = A002110(n) [primorials are the records].
For n = 2 .. 79, a(1+A300829(n)) = A000040(n).

A303762 a(0) = 1, and for n >= 1, a(n) is either the largest divisor of a(n-1) not already present in the sequence, or (if all divisors already used), a(n-1) * {the least prime p such that p does not divide a(n-1) and p*a(n-1) is not already present}.

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 10, 30, 210, 105, 35, 7, 14, 42, 21, 231, 77, 11, 22, 66, 33, 165, 55, 110, 330, 2310, 1155, 385, 770, 154, 462, 6006, 3003, 1001, 143, 13, 26, 78, 39, 195, 65, 130, 390, 2730, 1365, 455, 91, 182, 546, 273, 4641, 1547, 221, 17, 34, 102, 51, 255, 85, 170, 510, 3570, 1785, 595, 119, 238, 714, 357, 3927, 1309, 187, 374, 1122, 561, 2805, 935
Offset: 0

Views

Author

Antti Karttunen, May 03 2018

Keywords

Comments

Each a(n+1) is either a divisor or a multiple of a(n).
The construction is otherwise like that of A303760, except here we choose the largest divisor instead of the smallest one. In contrast to A303760, this sequence is NOT permutation of A005117: 70 = A019565(13) is the first missing squarefree number. See also comments in A303769, A303749 and A302775.
Index of greatest prime factor of a(n) is monotonic and increments at n = {0, 1, 2, 4, 8, 15, 31, 50, 102, 157, 317, 480, 964, 1451, 2907, 4366, 8738, 13113, 26233, 39356, ...} - Michael De Vlieger, May 22 2018

Examples

			From _Michael De Vlieger_, May 23 2018: (Start)
Table below shows the initial 31 terms at right. First column is index n. Second shows "." if a(n) = largest divisor of a(n-1), or factor p. Third shows presence "1" or absence "." of prime k among prime divisors of a(n).
   n   p\d    MN(n)      a(n)
  ---------------------------
   0     .    .            1
   1     2    1            2
   2     3    11           6
   3     .    .1           3
   4     5    .11         15
   5     .    ..1          5
   6     2    1.1         10
   7     3    111         30
   8     7    1111       210
   9     .    .111       105
  10     .    ..11        35
  11     .    ...1         7
  12     2    1..1        14
  13     3    11.1        42
  14     .    .1.1        21
  15    11    .1.11      231
  16     .    ...11       77
  17     .    ....1       11
  18     2    1...1       22
  19     3    11..1       66
  20     .    .1..1       33
  21     5    .11.1      165
  22     .    ..1.1       55
  23     2    1.1.1      110
  24     3    111.1      330
  25     7    11111     2310
  26     .    .1111     1155
  27     .    ..111      385
  28     2    1.111      770
  29     .    1..11      154
  30     3    11.11      462
  31    13    11.111    6006
  ...  (End)
		

Crossrefs

Subset of A005117.
Cf. A303760, A303761 (variants).

Programs

  • Mathematica
    Nest[Append[#, Block[{d = Divisors@ #[[-1]], p = 2}, If[Complement[d, #] != {}, Complement[d, #][[-1]], While[Nand[Mod[#[[-1]], p] != 0, FreeQ[#, p #[[-1]] ] ], p = NextPrime@ p]; p #[[-1]] ] ] ] &, {1}, 75] (* Michael De Vlieger, May 22 2018 *)
  • PARI
    default(parisizemax,2^31);
    up_to = 2^14;
    A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
    v303762 = vector(up_to);
    m_inverses = Map();
    prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,(prev/d)),v303762[n] = (prev/d);mapput(m_inverses,(prev/d),n);break)); if(!v303762[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303762[n] = try; mapput(m_inverses,try,n)); prev = v303762[n]);
    A303762(n) = v303762[n+1];

Formula

a(n) = A019565(A303769(n)). [Conjectured]

A304537 Suspected divisor-or-multiple permutation of squarefree numbers: a(n) = A019565(A304533(n)).

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 65, 13, 26, 182, 7, 14, 42, 21, 105, 35, 455, 91, 910, 10, 30, 210, 70, 2730, 39, 78, 546, 273, 1365, 195, 7995, 41, 82, 246, 123, 615, 205, 2665, 533, 1066, 11726, 11, 22, 66, 33, 165, 55, 715, 143, 286, 2002, 77, 154, 462, 231, 1155, 385, 5005, 1001, 10010, 110, 330, 2310, 770, 30030, 429, 858, 6006, 3003, 15015, 2145, 87945, 451, 902
Offset: 0

Views

Author

Antti Karttunen, May 15 2018

Keywords

Comments

Each a(n) is always either a divisor or a multiple of a(n+1).
Consider A052330. Imagine that it is an automatic piano that "plays sequences" when an appropriate punched "tape" is fed to it (as its input), i.e., when it is composed from the right with an appropriate sequence p, as A019565(p(n)). The 1-bits in the binary expansion of each p(n) are the "holes" in the tape, and they determine which "tunes" are present on beat n. The "tunes" are actually "Fermi-Dirac primes" (A050376) that are multiplied together.
If the tape is constructed in such a way that between the successive beats (when moving from p(n) to p(n+1)), either a subset of 0-bits are toggled on (changed to 1's), or a subset of 1-bits are toggled off (changed to 0's), but no both kind of changes occur simultaneously, then when fed as an input to this piano, the resulting sequence "s" (the output) is guaranteed to satisfy the condition that s(n+1) is either a multiple or a divisor of s(n). Furthermore, if the given sequence p is itself a permutation of natural numbers, then also the produced sequence is. For example, Gray code A003188 and its inverse A006068 are such sequences, and when given as an "input tape" for A052330, they produce permutations A207901 and A302783.
There is a simpler instrument, called "squarefree piano" (A019565), with which it is possible to produce similar divisor-or-multiple sequences, but that contain only squarefree numbers. Given A003188 or A006068 as an input tape for it produces correspondingly sequences A302033 and A284003.
This sequence is obtained by playing "squarefree piano" with the same tape which yields A304531 when "Fermi-Dirac piano" is played with it. However, in this case the sequence A304531 is produced by a greedy algorithm, and thus its tape (A304533) is actually a back-formation, obtained from the "music" (A304531) by applying "tape-recorder" (A052331) to it. Note that this in not a subsequence of A304531, as the terms occur in different order than the squarefree terms of A304531.
See also Peter Munn's Apr 11 2018 message on SeqFan-mailing list.

Crossrefs

Programs

Formula

a(n) = A019565(A304533(n)) = A019565(A052331(A304531(1+n))).

A366254 Binary weight of May code (A303767).

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 5, 4, 5, 6, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 5, 4, 5, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Oct 05 2023

Keywords

Crossrefs

Programs

Formula

a(n) = A000120(A303767(n)).
a(n) = A001221(A303760(n)) = A001222(A303760(n)) = A001222(A366261(n)).
a(n) = A064547(A303771(n)).

A303770 Divisor-or-multiple permutation of squarefree numbers: a(n) = A019565(A303773(n)).

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 10, 30, 210, 42, 21, 7, 14, 70, 35, 105, 1155, 165, 55, 11, 22, 66, 33, 231, 77, 154, 462, 2310, 330, 110, 770, 385, 5005, 455, 91, 13, 26, 78, 39, 195, 65, 130, 390, 2730, 182, 546, 273, 1365, 15015, 3003, 429, 143, 286, 858, 4290, 1430, 715, 2145, 36465, 561, 51, 17, 34, 102, 510, 170, 85, 255, 1785, 357, 119, 238, 714
Offset: 0

Views

Author

Antti Karttunen, May 05 2018

Keywords

Comments

Each a(n+1) is either a divisor or a multiple of a(n).

Crossrefs

Cf. A303760 (a simpler variant).

Programs

Formula

a(n) = A019565(A303773(n)).

A303772 Inverse of A303771.

Original entry on oeis.org

0, 1, 3, 5, 9, 2, 17, 6, 33, 10, 65, 4, 129, 18, 12, 257, 513, 34, 1025, 14, 20, 66, 2049, 7, 4097, 130, 36, 22, 8193, 11, 16385, 258, 68, 514, 26, 38, 32769, 1026, 132, 15, 65537, 19, 131073, 70, 42, 2050, 262145, 260
Offset: 1

Views

Author

Antti Karttunen, May 02 2018

Keywords

Crossrefs

Programs

  • PARI
    default(parisizemax,2^31);
    up_to_e = 18;
    up_to = (2 + 2^up_to_e);
    v050376 = vector(2+up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == 2+up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669
    v303760 = vector(up_to);
    m_inverses = Map();
    prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,d),v303760[n] = d;mapput(m_inverses,d,n);break)); if(!v303760[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303760[n] = try; mapput(m_inverses,try,n)); prev = v303760[n]);
    A303760(n) = v303760[n+1];
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A303771(n) = A052330(A048675(A303760(n)));
    m303772 = Map();
    for(n=0,up_to-1,mapput(m303772,A303771(n),n));
    A303772(n) = mapget(m303772,n);

Formula

a(n) = A303768(A052331(n)).

A366256 Positions of odd numbers in May code (A303767).

Original entry on oeis.org

1, 2, 6, 7, 8, 10, 11, 15, 16, 18, 19, 23, 24, 25, 27, 28, 34, 35, 39, 40, 41, 43, 44, 48, 49, 51, 52, 56, 57, 58, 60, 61, 66, 67, 71, 72, 73, 75, 76, 80, 81, 83, 84, 88, 89, 90, 92, 93, 99, 100, 104, 105, 106, 108, 109, 113, 114, 116, 117, 121, 122, 123, 125, 126, 130, 131, 135, 136, 137, 139, 140, 144, 145, 147
Offset: 1

Views

Author

Antti Karttunen, Oct 05 2023

Keywords

Crossrefs

Cf. A303767, A366255 (characteristic function), A366257 (complement).
Positions of even terms in A303760.

Programs

A366257 Positions of even numbers in May code (A303767).

Original entry on oeis.org

0, 3, 4, 5, 9, 12, 13, 14, 17, 20, 21, 22, 26, 29, 30, 31, 32, 33, 36, 37, 38, 42, 45, 46, 47, 50, 53, 54, 55, 59, 62, 63, 64, 65, 68, 69, 70, 74, 77, 78, 79, 82, 85, 86, 87, 91, 94, 95, 96, 97, 98, 101, 102, 103, 107, 110, 111, 112, 115, 118, 119, 120, 124, 127, 128, 129, 132, 133, 134, 138, 141, 142, 143, 146, 149
Offset: 1

Views

Author

Antti Karttunen, Oct 05 2023

Keywords

Crossrefs

Cf. A303767, A366256 (complement).
Positions of 0's in A366255. Positions of odd terms in A303760.

Programs

Showing 1-10 of 10 results.