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.

A005941 Inverse of the Doudna sequence A005940.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 17, 12, 33, 18, 11, 16, 65, 14, 129, 20, 19, 34, 257, 24, 13, 66, 15, 36, 513, 22, 1025, 32, 35, 130, 21, 28, 2049, 258, 67, 40, 4097, 38, 8193, 68, 23, 514, 16385, 48, 25, 26, 131, 132, 32769, 30, 37, 72, 259, 1026, 65537, 44, 131073, 2050, 39, 64
Offset: 1

Views

Author

Keywords

Comments

a(2^k) = 2^k. - Robert G. Wilson v, Feb 22 2005
Fixed points: A029747. - Reinhard Zumkeller, Aug 23 2006
Question: Is there a simple proof that a(c) = c would never allow an odd composite c as a solution? See also A364551. - Antti Karttunen, Jul 30 2023

References

  • J. H. Conway, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A103969. Inverse of A005940. One more than A156552.
Cf. A364559 [= a(n)-n], A364557 (Möbius transform), A364558.
Cf. A029747 [known positions where a(n) = n], A364560 [where a(n) <= n], A364561 [where a(n) <= n and n is odd], A364562 [where a(n) > n], A364548 [where n divides a(n)], A364549 [where odd n divides a(n)], A364550 [where a(n) divides n], A364551 [where a(n) divides n and n is odd].

Programs

  • Maple
    A005941 := proc(n)
        local k ;
        for k from 1 do
        if A005940(k) = n then # code reuse
            return k;
        end if;
        end do ;
    end proc: # R. J. Mathar, Mar 06 2010
  • Mathematica
    f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; t = Table[ f[n], {n, 10^5}]; Flatten[ Table[ Position[t, n, 1, 1], {n, 64}]] (* Robert G. Wilson v, Feb 22 2005 *)
  • PARI
    A005941(n) = { 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]); (1+res) }; \\ (After David A. Corneth's program for A156552) - Antti Karttunen, Jul 30 2023
  • Python
    from sympy import primepi, factorint
    def A005941(n): return sum((1<Chai Wah Wu, Mar 11 2023
    
  • Scheme
    (define (A005941 n) (+ 1 (A156552 n))) ;; Antti Karttunen, Jun 26 2014
    

Formula

a(n) = h(g(n,1,1), 0) / 2 + 1 with h(n, m) = if n=0 then m else h(floor(n/2), 2*m + n mod 2) and g(n, i, x) = if n=1 then x else (if n mod prime(i) = 0 then g(n/prime(i), i, 2*x+1) else g(n, i+1, 2*x)). - Reinhard Zumkeller, Aug 23 2006
a(n) = 1 + A156552(n). - Antti Karttunen, Jun 26 2014

Extensions

More terms from Robert G. Wilson v, Feb 22 2005
a(61) inserted by R. J. Mathar, Mar 06 2010

A364499 a(n) = A005940(n) - n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 4, 0, 12, 4, 12, 0, -6, -4, 2, 0, 14, 8, 22, 0, 24, 24, 48, 8, 96, 24, 50, 0, -20, -12, -2, -8, 18, 4, 24, 0, 36, 28, 62, 16, 130, 44, 88, 0, 72, 48, 96, 48, 192, 96, 170, 16, 286, 192, 316, 48, 564, 100, 180, 0, -48, -40, -28, -24, -4, -4, 28, -16, 18, 36, 90, 8, 198, 48, 110, 0, 62
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Compare to the scatter plot of A364563.
From Antti Karttunen, Aug 11 2023: (Start)
Can be computed as a certain kind of bitmask transformation of A364568 (analogous to the inverse Möbius transform that is appropriate for A156552-encoding of n).
See A364572, A364573 (and also A364576) for n (apart from those in A029747) where a(n) comes relatively close to the X-axis.
(End)

Examples

			A005940(528577) = 528581, therefore a(528577) = 528581 - 528577 = 4. (See A364576).
A005940(2109697) = 2109629, therefore a(2109697) = 2109629 - 2109697 = -68.
		

Crossrefs

Cf. A005940, A364500 [= gcd(n,a(n))], A364559, A364572, A364573, A364576.
Cf. A029747 (known positions of 0's), A364540 (positions of terms < 0), A364541 (of terms <= 0), A364542 (of terms >= 0), A364563 [= -a(A364543(n))].
Cf. also A364258, A364568.

Programs

  • Mathematica
    nn = 81; Array[Set[a[#], #] &, 2]; Do[If[EvenQ[n], Set[a[n], 2 a[n/2]], Set[a[n], Times @@ Power @@@ Map[{Prime[PrimePi[#1] + 1], #2} & @@ # &, FactorInteger[a[(n + 1)/2]]]]], {n, 3, nn}]; Array[a[#] - # &, nn] (* Michael De Vlieger, Jul 28 2023 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A364499(n) = (A005940(n)-n);
    
  • PARI
    A364499(n) = { my(m=1,p=2,x=0,z=1); n--; while(n, if(!(n%2), p=nextprime(1+p), x += m; z *= p); n>>=1; m <<=1); (z-x)-1; }; \\ Antti Karttunen, Aug 06 2023
    
  • Python
    from math import prod
    from itertools import accumulate
    from collections import Counter
    from sympy import prime
    def A364499(n): return prod(prime(len(a)+1)**b for a, b in Counter(accumulate(bin(n-1)[2:].split('1')[:0:-1])).items())-n # Chai Wah Wu, Aug 07 2023

Formula

a(n) = -A364559(A005940(n)).
For all n >= 1, a(2*n) = 2*a(n).
For all n >= 1, a(A029747(n)) = 0.

A364560 Numbers k for which A156552(k) < k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 30, 32, 35, 36, 40, 42, 45, 48, 49, 50, 54, 55, 60, 63, 64, 70, 72, 75, 77, 80, 81, 84, 90, 91, 96, 98, 99, 100, 105, 108, 110, 120, 121, 125, 126, 128, 135, 140, 143, 144, 147, 150, 154, 160, 162, 165, 168, 169, 175, 180, 182, 187, 189, 192, 195, 196
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Numbers k such that A005941(k) <= k.
Sequence A005940(A364542(.)) sorted into ascending order.
If k is a term, then also 2*k is present in this sequence, and vice versa.

Crossrefs

Positions of nonpositive terms in A364559.
Cf. A005941, A156552, A364542, A364562 (complement).
Subsequences: A029747, A364550, A364561 (odd terms).

Programs

  • PARI
    A156552(n) = { 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]); res };
    isA364560(n) = (A156552(n) < n);

A364558 a(n) = A364557(n) - A000010(n), where A364557 is the Möbius transform of A005941, and A000010 (Euler phi) is the Möbius transform of A000027.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 6, 0, 20, 2, -4, 0, 48, -2, 110, 0, -4, 6, 234, 0, -12, 20, -10, 4, 484, -4, 994, 0, -4, 48, -16, -4, 2012, 110, 8, 0, 4056, -4, 8150, 12, -16, 234, 16338, 0, -26, -12, 32, 40, 32716, -10, -24, 8, 92, 484, 65478, -8, 131012, 994, -20, 0, -16, -4, 262078, 96, 212, -16, 524218, -8, 1048504
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Crossrefs

Cf. A000010, A005941, A364557, A364559 (inverse Möbius transform), A364565 (positions of 0's), A364566 (of terms < 0).

Programs

  • PARI
    A364558(n) = (A364557(n)-eulerphi(n));
    
  • Python
    from math import prod
    from sympy import factorint, primepi
    def A364558(n): return (1<1 else 0 # Chai Wah Wu, Jul 29 2023

A364562 Numbers k for which A156552(k) > k.

Original entry on oeis.org

7, 11, 13, 14, 17, 19, 22, 23, 26, 28, 29, 31, 33, 34, 37, 38, 39, 41, 43, 44, 46, 47, 51, 52, 53, 56, 57, 58, 59, 61, 62, 65, 66, 67, 68, 69, 71, 73, 74, 76, 78, 79, 82, 83, 85, 86, 87, 88, 89, 92, 93, 94, 95, 97, 101, 102, 103, 104, 106, 107, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 127
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2023

Keywords

Comments

Numbers k such that A005941(k) > k.
If k is a term, then also 2*k is present in this sequence, and vice versa.

Crossrefs

Positions of strictly positive terms in A364559.
Cf. A005941, A156552, A364560 (complement).

Programs

  • PARI
    A156552(n) = { 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]); res };
    isA364562(n) = (A156552(n) > n);
Showing 1-5 of 5 results.