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

A246277 Column index of n in A246278: a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 5, 11, 1, 12, 2, 13, 4, 14, 1, 15, 1, 16, 7, 17, 3, 18, 1, 19, 11, 20, 1, 21, 1, 22, 6, 23, 1, 24, 2, 25, 13, 26, 1, 27, 5, 28, 17, 29, 1, 30, 1, 31, 10, 32, 7, 33, 1, 34, 19, 35, 1, 36, 1, 37, 9, 38, 3, 39, 1, 40, 8, 41, 1, 42
Offset: 1

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Comments

If n >= 2, n occurs in column a(n) of A246278.
By convention, a(1) = 0 because 1 does not occur in A246278.

Crossrefs

Terms of A348717 halved. A305897 is the restricted growth sequence transform.
Positions of terms 1 .. 8 in this sequence are given by the following sequences: A000040, A001248, A006094, A030078, A090076, A251720, A090090, A030514.
Cf. A078898 (has the same role with array A083221 as this sequence has with A246278).
This sequence is also used in the definition of the following permutations: A246274, A246276, A246675, A246677, A246683, A249815, A249817 (A249818), A249823, A249825, A250244, A250245, A250247, A250249.
Also in the definition of arrays A249821, A251721, A251722.
Sum of prime indices of a(n) is A359358(n) + A001222(n) - 1, cf. A326844.
A112798 lists prime indices, length A001222, sum A056239.

Programs

  • Mathematica
    a246277[n_Integer] := Module[{f, p, a064989, a},
      f[x_] := Transpose@FactorInteger[x];
      p[x_] := Which[
        x == 1, 1,
        x == 2, 1,
        True, NextPrime[x, -1]];
      a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
      a[1] = 0;
      a[x_] := If[EvenQ[x], x/2, NestWhile[a064989, x, OddQ]/2];
    a/@Range[n]]; a246277[84] (* Michael De Vlieger, Dec 19 2014 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A246277(n) = { if(1==n, 0, while((n%2), n = A064989(n)); (n/2)); };
    
  • PARI
    A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2); \\ Antti Karttunen, Apr 30 2022
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    def a064989(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    def a(n): return 0 if n==1 else n//2 if n%2==0 else a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; two different variants, the second one employing memoizing definec-macro)
    (define (A246277 n) (if (= 1 n) 0 (let loop ((n n)) (if (even? n) (/ n 2) (loop (A064989 n))))))
    (definec (A246277 n) (cond ((= 1 n) 0) ((even? n) (/ n 2)) (else (A246277 (A064989 n)))))
    

Formula

a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)) = a(A064216(n+1)). [Cf. the formula for A252463.]
Instead of the equation for a(2n+1) above, we may write a(A003961(n)) = a(n). - Peter Munn, May 21 2022
Other identities. For all n >= 1, the following holds:
For all w >= 0, a(p_{i} * p_{j} * ... * p_{k}) = a(p_{i+w} * p_{j+w} * ... * p_{k+w}).
For all n >= 2, A001222(a(n)) = A001222(n)-1. [a(n) has one less prime factor than n. Thus each semiprime (A001358) is mapped to some prime (A000040), etc.]
For all n >= 2, a(n) = A078898(A249817(n)).
For semiprimes n = p_i * p_j, j >= i, a(n) = A000040(1+A243055(n)) = p_{1+j-i}.
a(n) = floor(A348717(n)/2). - Antti Karttunen, Apr 30 2022
If n has prime factorization Product_{i=1..k} prime(x_i), then a(n) = Product_{i=2..k} prime(x_i-x_1+1). The opposite version is A358195, prime indices A358172, even bisection A241916. - Gus Wiseman, Dec 29 2022

A246675 Permutation of natural numbers: a(n) = A000079(A055396(n+1)-1) * ((2*A246277(n+1))-1).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 13, 10, 15, 64, 17, 128, 19, 18, 21, 256, 23, 12, 25, 14, 27, 512, 29, 1024, 31, 26, 33, 20, 35, 2048, 37, 42, 39, 4096, 41, 8192, 43, 22, 45, 16384, 47, 24, 49, 50, 51, 32768, 53, 36, 55, 66, 57, 65536, 59, 131072, 61, 38, 63, 52, 65, 262144, 67, 74, 69
Offset: 1

Views

Author

Antti Karttunen, Sep 01 2014

Keywords

Comments

Consider the square array A246278, and also A246275 which is obtained from the former when one is subtracted from each term.
In A246278 the even numbers occur at the top row, and all the rows below that contain only odd numbers, those subsequent terms in each column having been obtained by shifting all primes present in the prime factorization of number immediately above to one larger indices with A003961.
To compute a(n): we do the same process in reverse, by shifting primes in the prime factorization of n+1 step by step to smaller primes, until after k >= 0 such shifts with A064989, the result is even, with the smallest prime present being 2.
We subtract one from this even number and shift the binary expansion of the resulting odd number k positions left (i.e. multiply it with 2^k), which will be the result of a(n).
In the essence, a(n) tells which number in the array A135764 is at the same position where n is in the array A246275. As the topmost row in both arrays is A005408 (odd numbers), they are fixed, i.e., a(2n+1) = 2n+1 for all n.
A055396(n+1) tells on which row of A246275 n is, which is equal to the row of A246278 on which n+1 is.
A246277(n+1) tells in which column of A246275 n is, which is equal to the column of A246278 in which n+1 is.

Examples

			Consider 54 = 55-1. To find 55's position in array A246278, we start shifting its prime factorization 55 = 5 * 11 = p_3 * p_5, step by step: p_2 * p_4 (= 3 * 7 = 21), until we get an even number: p_1 * p_3 = 2*5 = 10.
This tells us that 55 is on row 3 and column 5 (= 10/2) of array A246278, thus 54 occurs in the same position at array A246275. In array A135764 the same position contains number (2^(3-1)) * (10-1) = 4*9 = 36, thus a(54) = 36.
		

Crossrefs

Inverse: A246676.
More recursed variants: A246677, A246683.
Even bisection halved: A246679.
Other related permutations: A054582, A135764, A246274, A246275, A246276.
a(n) differs from A156552(n+1) for the first time at n=13, where a(13) = 14, while A156552(14) = 17.

Programs

  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A246675(n) = { my(k=0); n++; while((n%2), n = A064989(n); k++); n--; while(k>0, n = 2*n; k--); n; };
    for(n=1, 2048, write("b246675.txt", n, " ", A246675(n)));
    
  • Scheme
    (define (A246675 n) (* (A000079 (- (A055396 (+ 1 n)) 1)) (-1+ (* 2 (A246277 (+ 1 n))))))

Formula

a(n) = A000079(A055396(n+1)-1) * ((2*A246277(n+1))-1).
As a composition of related permutations:
a(n) = A135764(A246276(n)).
a(n) = A054582(A246274(n)-1).
Other identities. For all n >= 0:
a(A005408(n)) = A005408(n). [Fixes the odd numbers.]

A134343 Expansion of psi(-x)^2 in powers of x where psi() is a Ramanujan theta function.

Original entry on oeis.org

1, -2, 1, -2, 2, 0, 3, -2, 0, -2, 2, -2, 1, -2, 0, -2, 4, 0, 2, 0, 1, -4, 2, 0, 2, -2, 0, -2, 2, -2, 1, -4, 0, 0, 2, 0, 4, -2, 2, -2, 0, 0, 3, -2, 0, -2, 4, 0, 2, -2, 0, -4, 0, 0, 0, -4, 3, -2, 2, 0, 2, -2, 0, 0, 2, -2, 4, -2, 0, -2, 2, 0, 3, -2, 0, 0, 4, 0, 2
Offset: 0

Views

Author

Michael Somos, Oct 21 2007

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number 57 of the 74 eta-quotients listed in Table I of Martin (1996).

Examples

			G.f. = 1 - 2*x + x^2 - 2*x^3 + 2*x^4 + 3*x^6 - 2*x^7 - 2*x^9 + 2*x^10 + ...
G.f. = q - 2*q^5 + q^9 - 2*q^13 + 2*q^17 + 3*q^25 - 2*q^29 - 2*q^37 + ...
		

Crossrefs

Programs

  • Magma
    A := Basis( ModularForms( Gamma1(64), 1), 321); A[2] - 2*A[6] + A[10] - 2*A[14] + 2*A[18] + 3*A[26] - 2*A[30] + 2*A[35] - 2*A[36]; /* Michael Somos, Jun 22 2015 */;
  • Mathematica
    a[ n_] := If[ n < 0, 0, (-1)^n DivisorSum[ 4 n + 1, (-1)^Quotient[#, 2] &]]; (* Michael Somos, Jun 22 2015 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, Pi/4, x^(1/2)]^2 / (2 x^(1/4)), {x, 0, n}]; (* Michael Somos, Jun 22 2015 *)
    a[ n_] := SeriesCoefficient[(QPochhammer[ x] QPochhammer[ x^4] / QPochhammer[ x^2])^2, {x, 0, n}]; (* Michael Somos, Jun 22 2015 *)
  • PARI
    {a(n) = if( n<0, 0, (-1)^n * sumdiv( 4*n + 1, d, (-1)^(d\2)))};
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( ( eta(x + A) * eta(x^4 + A) / eta(x^2 + A) )^2, n))};
    

Formula

Expansion of q^(-1/4) * (eta(q) * eta(q^4) / eta(q^2))^2 in powers of q.
Euler transform of period 4 sequence [ -2, 0, -2, -2, ...].
G.f. is a period 1 Fourier series which satisfies f(-1 / (64 t)) = 8 (t/i) f(t) where q = exp(2 Pi i t).
a(n) = b(4*n + 1) where b() is multiplicative with b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p == 3 (mod 4), b(p^e) = e+1 if p == 1 (mod 8), b(p^e) = (-1)^e * (e+1) if p == 5 (mod 8).
G.f.: (Product_{k>0} (1 - x^k) * (1 + x^(2*k)))^2.
a(9*n + 5) = a(9*n + 8) = 0. a(n) = (-1)^n * A008441(n). a(2*n) = A113407(n). a(2*n + 1) = -2 * A053692(n).
2 * a(n) = A204531(4*n + 1) = - A246950(n). a(4*n) = A246862(n). a(4*n + 2) = A246683(n). - Michael Somos, Jun 22 2015
a(4*n + 1) = -2 * A259287(n). a(4*n + 3) = -2 * A259285(n). - Michael Somos, Jun 24 2015
Convolution square is A121613. Convolution cube is A213791. Convolution with A000009 is A143379. Convolution with A000143 is A209942. Michael Somos, Jun 22 2015
G.f.: Sum_{k>0 odd} (x^k + x^(3*k)) / (1 + x^(4*k)) * (-1)^floor((k+1) / 4). - Michael Somos, Jun 22 2015
G.f.: Sum_{k>0 odd} (x^k - x^(3*k)) / (1 + x^(4*k)) * (-1)^floor(k / 4). - Michael Somos, Jun 22 2015

A246684 "Caves of prime shift" permutation: a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 15, 24, 13, 26, 11, 10, 17, 20, 27, 34, 29, 80, 47, 48, 25, 32, 51, 124, 21, 44, 19, 12, 33, 74, 39, 54, 53, 98, 67, 76, 57, 104, 159, 624, 93, 404, 95, 120, 49, 50, 63, 64, 101, 152, 247, 342, 41, 38, 87, 174, 37, 62, 23, 16, 65, 56, 147, 244, 77, 188, 107, 90, 105, 374, 195, 324, 133, 170, 151, 142, 113, 92
Offset: 1

Views

Author

Antti Karttunen, Sep 06 2014

Keywords

Comments

See the comments in A246676. This is otherwise similar permutation, except that after having reached an odd number 2m-1 when we have shifted the binary representation of n right k steps, here, in contrary to A246676, we don't shift the primes in the prime factorization of the even number 2m, but instead of an even number (2*a(m)), shifting it the same number (k) of positions towards larger primes, whose product is then decremented by one to get the final result.
From Antti Karttunen, Jan 18 2015: (Start)
This can be viewed as an entanglement or encoding permutation where the complementary pairs of sequences to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with another complementary pair: even numbers in the order they appear in A253885 and odd numbers in their usual order: (A253885/A005408).
From the above follows also that this sequence can be represented as a binary tree. Each child to the left is obtained by doubling the parent and subtracting one, and each child to the right is obtained by applying A253885 to the parent:
1
|
...................2...................
3 4
5......../ \........8 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
9 14 15 24 13 26 11 10
17 20 27 34 29 80 47 48 25 32 51 124 21 44 19 12
(End)

Examples

			Consider n=30, "11110" in binary. It has to be shifted just one bit-position right that the result were an odd number 15, "1111" in binary. As 15 = 2*8-1, we use 2*a(8) = 2*6 = 12 = 2*2*3 = p_1 * p_1 * p_2 [where p_k denotes the k-th prime, A000040(k)], which we shift one step towards larger primes resulting p_2 * p_2 * p_3 = 3*3*5 = 45, thus a(30) = 45-1 = 44.
		

Crossrefs

Inverse: A246683.
Other versions: A246676, A246678.
Similar or related permutations: A005940, A163511, A241909, A245606, A246278, A246375, A249814, A250243.
Differs from A249814 for the first time at n=14, where a(14) = 26, while A249814(14) = 20.

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
    A246684(n) = { my(k=0); if(1==n, 1, while(!(n%2), n = n/2; k++); n = 2*A246684((n+1)/2); while(k>0, n = A003961(n); k--); n-1); };
    for(n=1, 8192, write("b246684.txt", n, " ", A246684(n)));
    (Scheme, with memoization-macro definec, two implementations)
    (definec (A246684 n) (cond ((<= n 1) n) (else (+ -1 (A242378bi (A007814 n) (* 2 (A246684 (A003602 n)))))))) ;; Code for A242378bi given in A242378.
    (definec (A246684 n) (cond ((<= n 1) n) ((even? n) (A253885 (A246684 (/ n 2)))) (else (+ -1 (* 2 (A246684 (/ (+ n 1) 2)))))))

Formula

a(1) = 1, a(n) = A242378(A007814(n), 2*a(A003602(n))) - 1. [Where the bivariate function A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n].
a(1) = 1, a(2n) = A253885(a(n)), a(2n+1) = (2*a(n+1))-1. - Antti Karttunen, Jan 18 2015
As a composition of other permutations:
a(n) = A250243(A249814(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back].
For all n >= 0, the following holds: a(A000051(n)) = A000051(n). [Numbers of the form 2^n + 1 are among the fixed points].

A250244 Permutation of natural numbers: a(n) = A249741(A055396(n+1), a(A246277(n+1))).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 16 2014

Keywords

Comments

This is a "more recursed" variant of A249815. Preserves the parity of n.

Crossrefs

Inverse: A250243.
Similar or related permutations: A246683, A249814, A250245.
Differs from A249816 and A250243 for the first time at n=32, where a(32) = 38, while A249816(32) = A250243(32) = 44.
Differs from the "shallow variant" A249815 for the first time at n=39, where a(39) = 51, while A249815(39) = 39

Formula

a(n) = A249741(A055396(n+1), a(A246277(n+1))).
As a composition of other permutations:
a(n) = A249814(A246683(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1)) / 2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back.]
a(A006093(n)) = A006093(n). [Primes minus one are among the fixed points].

A249813 Permutation of natural numbers: a(1) = 1, a(n) = A000079(A055396(n+1)-1) * ((2 * a(A078898(n+1))) - 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 15, 32, 13, 10, 11, 64, 17, 128, 31, 14, 29, 256, 63, 12, 25, 18, 19, 512, 21, 1024, 127, 30, 33, 20, 255, 2048, 61, 26, 27, 4096, 57, 8192, 511, 22, 125, 16384, 23, 24, 49, 34, 35, 32768, 37, 28, 1023, 62, 41, 65536, 2047, 131072, 253, 58, 59, 36, 65, 262144, 39, 126, 509, 524288, 4095, 1048576, 121, 50, 51, 40, 53
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

This sequence is a "recursed variant" of A249812.
See also the comments at the inverse permutation A249814.

Crossrefs

Inverse: A249814.
Similar or related permutations: A246683, A249812, A250243.
Differs from A246683 for the first time at n=20, where a(20) = 14, while A246683(20) = 18.

Formula

a(1) = 1, a(n) = A000079(A055396(n+1)-1) * ((2 * a(A078898(n+1))) - 1).
As a composition of other permutations:
a(n) = A246683(A250243(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back.]
a(A006093(n)) = A000079(n-1).

A246677 Permutation of natural numbers: a(1) = 1, a(2n) = A000079(A055396(2n+1)-1) * ((2*A246277(2n+1))-1), a(2n+1) = 1 + 2*a(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 26, 129, 20, 27, 2048, 257, 42, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 50, 131, 32768, 29, 36, 71, 66, 1025, 65536, 43, 131072, 2049, 38, 63, 52, 53, 262144, 259, 74, 41
Offset: 1

Views

Author

Antti Karttunen, Sep 01 2014

Keywords

Comments

See the comments in A246675. This is otherwise similar permutation, except for odd numbers, which are here recursively permuted by the emerging permutation itself. The even bisection halved gives A246679, the odd bisection from a(3) onward with one subtracted and then halved gives this sequence back.

Crossrefs

Inverse: A246678. Variants: A246675, A246683.
Even bisection halved: A246679.
a(n) differs from A156552(n+1) for the first time at n=32, where a(32) = 26, while A156552(33) = 34.

Formula

a(1) = 1, a(2n) = A000079(A055396(2n+1)-1) * ((2*A246277(2n+1))-1), a(2n+1) = 1 + 2*a(n).

A269383 Permutation of natural numbers: a(1) = 1, a(n) = A000079(A260738(n+1)-1) * ((2 * a(A260739(n+1))) - 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 15, 32, 13, 10, 11, 64, 17, 12, 31, 14, 29, 128, 63, 256, 25, 18, 19, 512, 21, 24, 127, 30, 33, 20, 23, 1024, 61, 26, 27, 2048, 57, 4096, 255, 22, 125, 8192, 511, 28, 49, 34, 35, 16384, 37, 48, 1023, 62, 41, 40, 47, 32768, 253, 58, 59, 36, 65, 65536, 39, 126, 45, 131072, 2047, 96, 121, 50, 51, 262144, 53, 60
Offset: 1

Views

Author

Antti Karttunen, Mar 01 2016

Keywords

Crossrefs

Inverse: A269384.
Cf. also A249813, A269373.
Differs from both A246683 and A249813 for the first time at n=18, which here a(18)=12, instead of 128.

Formula

a(1) = 1, a(n) = A000079(A260738(n+1)-1) * ((2 * a(A260739(n+1))) - 1).
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
Showing 1-8 of 8 results.