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

A243071 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 255, 28, 29, 62, 511, 24, 11, 126, 9, 60, 1023, 26, 2047, 16, 61, 254, 27, 20, 4095, 510, 125, 56, 8191, 58, 16383, 124, 25, 1022, 32767, 48, 23, 22, 253, 252, 65535, 18, 59, 120, 509, 2046, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
See also the comments at A163511, which is the inverse permutation to this one.

Crossrefs

Inverse: A163511.
Cf. A000040, A000225, A007814, A054429, A064989, A064216, A122111, A209229, A245611 (= (a(2n-1)-1)/2, for n > 1), A245612, A292383, A292385, A297171 (Möbius transform).
Cf. A007283 (known positions where a(n)=n), A364256 [= gcd(n,a(n))], A364288 [= n-a(n)], A364289 [where a(n)>=n], A364290 [where a(n)A364291 [where a(n)<=n], A364497 [where n|a(n)].
Cf. A156552 (variant with inverted binary code), A253566, A332215, A332811, A334859 (other variants).

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)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n))))); \\ Antti Karttunen, Jul 18 2020
    
  • PARI
    A243071(n) = if(n<=2, n-1, my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p*p2*(2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); ((3<<#binary(res\2))-res-1)); \\ (Combining programs given in A156552 and A054429) - Antti Karttunen, Jul 28 2023
    
  • Python
    from functools import reduce
    from sympy import factorint, prevprime
    from operator import mul
    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 n - 1 if n<3 else 2*a(n//2) if n%2==0 else 1 + 2*a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library.
    (definec (A243071 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A243071 (/ n 2)))) (else (+ 1 (* 2 (A243071 (A064989 n)))))))
    

Formula

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).
For n >= 1, a(A000040(n)) = A000225(n).
For n >= 1, a(2n+1) = 1 + 2*a(A064216(n+1)).
From Antti Karttunen, Jul 18 2020: (Start)
a(n) = A245611(A048673(n)).
a(n) = A253566(A122111(n)).
a(n) = A334859(A225546(n)).
For n >= 2, a(n) = A054429(A156552(n)).
a(n) = A292383(n) + A292385(n) = A292383(n) OR A292385(n).
For n > 1, A007814(a(n)) = A007814(n) - A209229(n). [This map preserves the 2-adic valuation of n, except when n is a power of two, in which cases it is decremented by one.]
(End)

A334860 a(0) = 1, a(1) = 2, after which, a(2n) = A334747(a(n)), a(2n+1) = a(n)^2.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 8, 16, 5, 36, 18, 81, 12, 64, 32, 256, 10, 25, 72, 1296, 27, 324, 162, 6561, 24, 144, 128, 4096, 48, 1024, 512, 65536, 15, 100, 50, 625, 108, 5184, 2592, 1679616, 54, 729, 648, 104976, 243, 26244, 13122, 43046721, 20, 576, 288, 20736, 192, 16384, 8192, 16777216, 96, 2304, 2048, 1048576, 768, 262144, 131072, 4294967296, 30
Offset: 0

Views

Author

Antti Karttunen, Jun 08 2020

Keywords

Comments

This irregular table can be represented as a binary tree. Each child to the left is obtained by applying A334747 to the parent, and each child to the right is obtained by squaring the parent:
1
|
...................2...................
3 4
6......../ \........9 8......../ \........16
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
5 36 18 81 12 64 32 256
10 25 72 1296 27 324 162 6561 24 144 128 4096 48 1024 512 65536
etc.
This is the mirror image of the tree in A334866.
Fermi-Dirac primes, A050376, occur at rightward growing branches that originate from primes situated at the left edge.
The tree illustrated in A163511 is expanded as x -> 2*x for the left child and x -> A003961(x) for the right child, while this tree is expanded as x -> A225546(2*A225546(x)) for the left child, and x -> A225546(A003961(A225546(x))) for the right child.

Crossrefs

Cf. A000290, A225546, A334204, A334747, A334859 (inverse), A334866 (mirror image).
Cf. A001146 (right edge of the tree), A019565 (left edge), A334110 (the right children of the left edge).
Composition of permutations A163511 and A225546.

Programs

Formula

a(0) = 1, a(1) = 2; and for n > 0, a(2n) = A334747(a(n)), a(2n+1) = a(n)^2.
a(n) = A225546(A163511(n)).
For n >= 0, a(2^n) = A019565(1+n), a(2^((2^n)-1)) = A000040(1+n).
A334109(a(n)) = A334204(n).
It seems that for n >= 1, A048675(a(n)) = A135529(n) = A048675(A163511(n)).

A334871 Number of steps needed to reach 1 when starting from n and iterating with A334870.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 8, 3, 3, 5, 16, 4, 32, 9, 6, 3, 64, 4, 128, 6, 10, 17, 256, 5, 5, 33, 5, 10, 512, 7, 1024, 4, 18, 65, 12, 4, 2048, 129, 34, 7, 4096, 11, 8192, 18, 7, 257, 16384, 5, 9, 6, 66, 34, 32768, 6, 20, 11, 130, 513, 65536, 8, 131072, 1025, 11, 4, 36, 19, 262144, 66, 258, 13, 524288, 5, 1048576, 2049, 7, 130
Offset: 1

Views

Author

Antti Karttunen, Jun 08 2020

Keywords

Comments

Distance of n from the root (1) in binary trees like A334860 and A334866.
Each n > 0 occurs 2^(n-1) times.
a(n) is the size of the inner lining of the integer partition with Heinz number A225546(n), which is also the size of the largest hook of the same partition. (After Gus Wiseman's Apr 02 2019 comment in A252464).

Crossrefs

Programs

  • PARI
    A334870(n) = if(issquare(n),sqrtint(n),my(c=core(n), m=n); forprime(p=2, , if(!(c % p), m/=p; break, m*=p)); (m));
    A334871(n) = { my(s=0); while(n>1,s++; n = A334870(n)); (s); };
    
  • PARI
    \\ Much faster:
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A334871(n) = { my(s=0); while(n>1, if(issquare(n), s++; n = sqrtint(n), s += A048675(core(n)); n /= core(n))); (s); };

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A334870(n)).
a(n) = A252464(A225546(n)).
a(n) = A048675(A007913(n)) + a(A008833(n)).
For n > 1, a(n) = 1 + A048675(A007913(n)) + a(A000188(n)).
For n > 1, a(n) = A070939(A334859(n)) = A070939(A334865(n)).
For all n >= 1, a(n) >= A299090(n).
For all n >= 1, a(n) >= A334872(n).

A334872 Number of steps needed to reach either 1 or one of the "Fermi-Dirac primes" (A050376) when starting from n and iterating with A334870.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 2, 0, 0, 1, 0, 4, 2, 1, 0, 3, 0, 1, 2, 8, 0, 3, 0, 1, 2, 1, 4, 2, 0, 1, 2, 5, 0, 3, 0, 16, 4, 1, 0, 2, 0, 1, 2, 32, 0, 3, 4, 9, 2, 1, 0, 6, 0, 1, 8, 2, 4, 3, 0, 64, 2, 5, 0, 3, 0, 1, 2, 128, 8, 3, 0, 4, 0, 1, 0, 10, 4, 1, 2, 17, 0, 5, 8, 256, 2, 1, 4, 3, 0, 1, 16, 2, 0, 3, 0, 33, 6
Offset: 1

Views

Author

Antti Karttunen, Jun 08 2020

Keywords

Crossrefs

Cf. A050376 (positions of zeros after 1), A302777, A334859, A334865, A334870, A334871.

Programs

  • PARI
    A209229(n) = (n && !bitand(n,n-1));
    A302777(n) = A209229(isprimepower(n));
    A334870(n) = if(issquare(n),sqrtint(n),my(c=core(n), m=n); forprime(p=2, , if(!(c % p), m/=p; break, m*=p)); (m));
    A334872(n) = { my(s=0); while(n>1 && !A302777(n), s++; n = A334870(n)); (s); };
    
  • PARI
    \\ Much faster, A302777 like in above:
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A052126(n) = if(1==n,n,(n/vecmax(factor(n)[, 1])));
    A334872(n) = { my(s=0); while(n>1 && !A302777(n), if(issquarefree(n), return(s+A048675(A052126(n)))); if(issquare(n), s++; n = sqrtint(n), s += A048675(core(n)); n /= core(n))); (s); };

Formula

If n = 1 or A302777(n) = 1, a(n) = 0, otherwise a(n) = 1 + a(A334870(n)).
For all n >= 1, a(n) <= A334871(n).

A334865 a(n) = A156552(A225546(n)).

Original entry on oeis.org

0, 1, 3, 2, 15, 7, 255, 5, 6, 31, 65535, 11, 4294967295, 511, 63, 4, 18446744073709551615, 13, 340282366920938463463374607431768211455, 47, 1023, 131071, 115792089237316195423570985008687907853269984665640564039457584007913129639935, 23, 30, 8589934591, 27, 767
Offset: 1

Views

Author

Antti Karttunen, Jun 08 2020

Keywords

Crossrefs

Inverse permutation of A334866. Composition of permutations A156552 and A225546, and also of A054429 and A334859.
Cf. A334871.

Formula

a(n) = A156552(A225546(n)).
a(n) = A054429(A334859(n)).
For n > 1, A070939(a(n)) = A334871(n).
Showing 1-5 of 5 results.