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.

Previous Showing 41-50 of 62 results. Next

A096116 a(1)=1, if n=(2^k)+1, a(n) = k+2, otherwise a(n) = 2+A000523(n-1)+a(2+A035327(n-1)).

Original entry on oeis.org

1, 2, 3, 5, 4, 9, 7, 6, 5, 11, 12, 14, 9, 10, 8, 7, 6, 13, 14, 16, 15, 20, 18, 17, 11, 12, 13, 15, 10, 11, 9, 8, 7, 15, 16, 18, 17, 22, 20, 19, 18, 24, 25, 27, 22, 23, 21, 20, 13, 14, 15, 17, 16, 21, 19, 18, 12, 13, 14, 16, 11, 12, 10, 9, 8, 17, 18, 20, 19, 24, 22, 21, 20, 26
Offset: 1

Views

Author

Amarnath Murthy, Jun 30 2004

Keywords

Comments

Each n > 1 occurs A025147(n) times in the sequence.

Crossrefs

Programs

  • Mathematica
    a = {1}; Do[AppendTo[a, If[BitAnd[n - 1, n - 2] == 0, Log2[n - 1] + 2, 2 + Floor[Log2[n - 1]] + a[[2 + BitXor[n - 1, 2^Ceiling[Log2[n]] - 1]]]]], {n, 2, 74}]; a (* Ivan Neretin, Jun 24 2016 *)
  • Scheme
    (define (A096116 n) (cond ((= 1 n) 1) ((pow2? (- n 1)) (+ 2 (A000523 (- n 1)))) (else (+ 2 (A000523 (- n 1)) (A096116 (+ 2 (A035327 (- n 1))))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
    ;; Antti Karttunen, Aug 25 2006

Extensions

Edited and extended by Antti Karttunen, Aug 25 2006

A186286 a(n) is the numerator of the rational number whose "factorization" into terms of A186285 has the balanced ternary representation corresponding to n.

Original entry on oeis.org

1, 2, 3, 3, 6, 5, 5, 10, 5, 5, 10, 15, 15, 30, 7, 7, 14, 7, 7, 14, 21, 21, 42, 7, 7, 14, 7, 7, 14, 21, 21, 42, 35, 35, 70, 35, 35, 70, 105, 105, 210, 4, 8, 16, 4, 8, 16, 12, 24, 48, 4, 8, 16, 4, 8, 16, 12, 24, 48, 20, 40, 80, 20, 40, 80, 60, 120, 240, 4, 8, 16, 4, 8, 16, 12, 24, 48, 4, 8
Offset: 0

Views

Author

Daniel Forgues, Feb 17 2011

Keywords

Comments

Numerators from the ordering of positive rational numbers by increasing balanced ternary representation of the "factorization" of positive rational numbers into terms of A186285 (prime powers with a power of three as exponent).

Examples

			The balanced ternary digits {-1,0,+1} are represented here as {2,0,1}.
   n BalTern A186286/A186287 (in reduced form)
   0      0  Empty product = 1 = 1/1, a(n) = 1
   1      1  2 = 2/1,                 a(n) = 2
   2     12  3*(1/2) = 3/2,           a(n) = 3
   3     10  3 = 3/1,                 a(n) = 3
   4     11  3*2 = 6 = 6/1,           a(n) = 6
   5    122  5*(1/3)*(1/2) = 5/6,     a(n) = 5
   6    120  5*(1/3) = 5/3,           a(n) = 5
   7    121  5*(1/3)*2 = 10/3,        a(n) = 10
  ...   ...
  41  12222  8*(1/7)*(1/5)*(1/3)*(1/2) = 8/210 = 4/105, a(n) = 4
		

Crossrefs

Formula

The balanced ternary representation of n
n = Sum(i=0..1+floor(log_3(2|n|)) n_i * 3^i, n_i in {-1,0,1},
is taken as the representation of the "factorization" of the positive rational number c(n)/d(n) into terms from A186285
c(n)/d(n) = Prod(i=0..1+floor(log_3(2|n|)) (A186285(i+1))^(n_i), where A186285(i+1) is the (i+1)th prime power with exponent being a power of 3. Then a(n) is the numerator, i.e., c(n).

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))).

A305417 Permutation of natural numbers: a(0) = 1, a(2n) = A305421(a(n)), a(2n+1) = 2*a(n).

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 11, 14, 9, 12, 21, 10, 15, 16, 13, 22, 29, 28, 49, 18, 27, 24, 69, 42, 63, 20, 107, 30, 17, 32, 19, 26, 23, 44, 35, 58, 39, 56, 127, 98, 83, 36, 151, 54, 45, 48, 81, 138, 207, 84, 475, 126, 65, 40, 743, 214, 189, 60, 273, 34, 51, 64, 25, 38, 53, 52, 121, 46, 57, 88, 173, 70, 101, 116, 233, 78, 105, 112, 199, 254, 129
Offset: 0

Views

Author

Antti Karttunen, Jun 10 2018

Keywords

Comments

This is GF(2)[X] analog of A005940, but note the indexing: here the domain starts from 0, although the range excludes zero.
This sequence can be represented as a binary tree. Each child to the left is obtained by applying A305421 to the parent, and each child to the right is obtained by doubling the parent:
1
|
...................2...................
3 4
7......../ \........6 5......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
11 14 9 12 21 10 15 16
13 22 29 28 49 18 27 24 69 42 63 20 107 30 17 32
Sequence A305427 is obtained by scanning the same tree level by level from right to left.

Crossrefs

Cf. A305418 (inverse), A305427 (mirror image).
Cf. A014580 (left edge from 2 onward), A305421.
Cf. also A005940, A052330, A091202.

Programs

  • PARI
    A091225(n) = polisirreducible(Pol(binary(n))*Mod(1, 2));
    A305420(n) = { my(k=1+n); while(!A091225(k),k++); (k); };
    A305421(n) = { my(f = subst(lift(factor(Pol(binary(n))*Mod(1, 2))),x,2)); for(i=1,#f~,f[i,1] = Pol(binary(A305420(f[i,1])))); fromdigits(Vec(factorback(f))%2,2); };
    A305417(n) = if(0==n,(1+n),if(!(n%2),A305421(A305417(n/2)),2*(A305417((n-1)/2))));

Formula

a(0) = 1, a(2n) = A305421(a(n)), a(2n+1) = 2*a(n).
a(n) = A305427(A054429(n)).
For all n >= 1, a(A000079(n-1)) = A014580(n).

A323082 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -(n mod 2) if n is a prime, and f(n) = A300840(n) for any other number.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 4, 6, 7, 3, 8, 3, 9, 10, 11, 3, 6, 3, 12, 13, 14, 3, 8, 15, 16, 17, 18, 3, 10, 3, 11, 19, 20, 21, 22, 3, 23, 24, 12, 3, 13, 3, 25, 26, 27, 3, 28, 29, 15, 30, 31, 3, 17, 32, 18, 33, 34, 3, 35, 3, 36, 37, 38, 39, 19, 3, 40, 41, 21, 3, 22, 3, 42, 43, 44, 45, 24, 3, 46, 47, 48, 3, 49, 50, 51, 52, 25, 3, 26, 53, 54, 55, 56, 57, 28, 3, 29, 58, 59, 3, 30, 3, 31
Offset: 1

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Comments

For all i, j: A323074(i) = A323074(j) => a(i) = a(j).
Like the related A322822 also this filter sequence satisfies the following two implications, for all i, j >= 1:
a(i) = a(j) => A322356(i) = A322356(j),
a(i) = a(j) => A290105(i) = A290105(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    ispow2(n) = (n && !bitand(n,n-1));
    A302777(n) = ispow2(isprimepower(n));
    A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1,oo,if(A302777(n), i++; v[i] = n); if(i == up_to,return(v))); };
    v050376 = A050376list(up_to);
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&A302777(n/d), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
    A300840(n) = A052330(A052331(n)>>1);
    A323082aux(n) = if(isprime(n),-(n%2),A300840(n));
    v323082 = rgs_transform(vector(up_to,n,A323082aux(n)));
    A323082(n) = v323082[n];

A160102 Multiplicative function, one-to-one and onto the squarefree numbers.

Original entry on oeis.org

1, 2, 3, 5, 7, 6, 11, 10, 13, 14, 17, 15, 19, 22, 21, 23, 29, 26, 31, 35, 33, 34, 37, 30, 41, 38, 39, 55, 43, 42, 47, 46, 51, 58, 77, 65, 53, 62, 57, 70, 59, 66, 61, 85, 91, 74, 67, 69, 71, 82, 87, 95, 73, 78, 119, 110, 93, 86, 79, 105, 83, 94, 143, 115, 133, 102, 89, 145
Offset: 1

Views

Author

Keywords

Comments

Multiplicative with a(A050376(m)) = Prime(m) = A000040(m). If k = 2^{i_1} + ... + 2^{i_j} is the binary representation of k, a(p^k) = a(p^2^{i_1}) * ... * a(p^2^{i_j}). [edited by Peter Munn, Jan 07 2020]
Equivalently, a(A050376(m)) = A000040(m); a(A059897(n,k)) = A059897(a(n), a(k)). - Peter Munn, Dec 30 2019

Crossrefs

Sequences used in definitions of this sequence: A000040, A019565, A050376, A052331, A059897.
Cf. A005117 (range of values), A052330.

Programs

  • PARI
    al(n)={local(v,k,fm,m,p);
    v=vector(n);v[1]=1;p=1;
    for(k=2,n,fm=factor(k);
    if(matsize(fm)[1]>1,m=fm[1,1]^fm[1,2];v[k]=v[m]*v[k/m],
    m=2^valuation(fm[1,2],2);
    if(m==fm[1,2],p=nextprime(p+1);v[k]=p,
    m=fm[1,1]^m;v[k]=v[m]*v[k/m])));
    v}

Formula

From Peter Munn, Dec 30 2019: (Start)
a(n) = A019565(A052331(n)).
a(A052330(k)) = A019565(k).
(End)

A298480 Lexicographically earliest sequence of distinct positive terms such that the Fermi-Dirac factorizations of two consecutive terms differ by exactly one factor.

Original entry on oeis.org

1, 2, 6, 3, 12, 4, 8, 24, 120, 30, 10, 5, 15, 60, 20, 40, 280, 56, 14, 7, 21, 42, 168, 84, 28, 140, 35, 70, 210, 105, 420, 840, 7560, 1080, 216, 54, 18, 9, 27, 108, 36, 72, 360, 90, 45, 135, 270, 1890, 378, 126, 63, 189, 756, 252, 504, 1512, 16632, 1848, 264
Offset: 1

Views

Author

Rémy Sigrist, Jul 21 2018

Keywords

Comments

For Fermi-Dirac representation of n see A182979. - N. J. A. Sloane, Jul 21 2018
For any n > 0, either a(n)/a(n+1) or a(n+1)/a(n) belongs to A050376.
This sequence has similarities with A282291; in both sequences, each pair of consecutive terms contains a term that divides the other.

Examples

			The first terms, alongside a(n+1)/a(n), are:
  n   a(n)  a(n+1)/a(n)
  --  ----  -----------
   1     1        2
   2     2        3
   3     6      1/2
   4     3        2^2
   5    12      1/3
   6     4        2
   7     8        3
   8    24        5
   9   120      1/2^2
  10    30      1/3
  11    10      1/2
  12     5        3
  13    15        2^2
  14    60      1/3
  15    20        2
  16    40        7
  17   280      1/5
  18    56      1/2^2
  19    14      1/2
  20     7        3
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A000120(A052331(a(n)) XOR A052331(a(n+1))) = 1 for any n > 0 (where XOR denotes the bitwise XOR operator).
Apparently, a(n) = A052330(A163252(n-1)) for any n > 0.

A302854 Inverse of A302853: if A302853(k) = n, a(n) = k, or -1 if n does not occur in A302853.

Original entry on oeis.org

0, 1, 3, 2, 5, 25, 4, 26, 7, 8, 10, 9, 6, 28, 11, 27, 13, 14, 16, 15, 18, 30, 17, 31, 20, 21, 23, 22, 19, 29, 12, 24, 65, 66, 7483, 7484, 70, 90, 7488, 7508, 68, 67, 7486, 7485, 69, 91, 7487, 7509, 72, 73, 7490, 7491, 71, 93, 7489, 7511, 75, 74, 7493, 7492, 76, 92, 7494, 7510, 33, 34, 36, 35, 38, 58, 37, 59, 40, 41, 43, 42, 39
Offset: 0

Views

Author

Antti Karttunen, May 17 2018

Keywords

Comments

This is a left inverse of A302853, and also the right inverse if A282291 (and thus also A302853) is surjective (a permutation of natural numbers), in which case the fallback-clause is unnecessary.

Crossrefs

Cf. A302853 (inverse).

Programs

Formula

For all n >= 0, a(A302853(n)) = n.

A304745 Restricted growth sequence transform of A046523(A207901(n)).

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 6, 7, 4, 5, 8, 9, 3, 10, 3, 2, 3, 10, 11, 10, 12, 13, 8, 9, 4, 5, 8, 9, 3, 10, 3, 2, 4, 9, 8, 5, 14, 15, 14, 16, 17, 18, 19, 18, 8, 13, 12, 9, 4, 9, 8, 5, 14, 15, 14, 16, 20, 21, 22, 21, 6, 5, 4, 7, 4, 9, 8, 5, 14, 15, 14, 16, 17, 18, 19, 18, 8, 13, 12, 9, 12, 23, 24, 13, 25, 26, 25, 27, 17, 18, 19, 18, 8, 13, 12, 9, 3, 10, 11, 10, 12, 13, 8
Offset: 0

Views

Author

Antti Karttunen, May 27 2018

Keywords

Comments

For all i, j: a(i) = a(j) => A005811(i) = A005811(j).

Crossrefs

Programs

  • PARI
    up_to_e = 17; \\ Good for computing up to n = (2^up_to_e)-1
    v050376 = vector(up_to_e);
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A003188(n) = bitxor(n, n>>1);
    A207901(n) = A052330(A003188(n));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    v304745 = rgs_transform(vector(65538,n,A046523(A207901(n-1))));
    A304745(n) = v304745[1+n];

A322823 a(n) = 0 if n is 1 or a Fermi-Dirac prime (A050376), otherwise a(n) = 1 + a(A300840(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 29 2018

Keywords

Comments

For n > 1, a(n) gives the number of edges needed to traverse from n to reach the leftmost branch (where the terms of A050376 are located) in the binary tree illustrated in A052330.

Crossrefs

Programs

  • PARI
    up_to = 10000;
    ispow2(n) = (n && !bitand(n,n-1));
    A302777(n) = ispow2(isprimepower(n));
    A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1,oo,if(A302777(n), i++; v[i] = n); if(i == up_to,return(v))); };
    v050376 = A050376list(up_to);
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
    A300840(n) = A052330(A052331(n)>>1);
    A322823(n) = if((1==n)||(1==A302777(n)),0,1+A322823(A300840(n)));

Formula

a(1) = 0; for n > 1, if A302777(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(A300840(n)).
Previous Showing 41-50 of 62 results. Next