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 21-30 of 118 results. Next

A246266 Permutation of natural numbers: a(n) = A246262(A064216((2*n)-1)).

Original entry on oeis.org

1, 2, 3, 6, 8, 5, 4, 11, 9, 15, 20, 7, 12, 26, 17, 32, 16, 21, 35, 18, 10, 22, 39, 31, 42, 47, 14, 53, 55, 25, 28, 13, 38, 40, 67, 41, 34, 72, 29, 81, 46, 24, 62, 87, 52, 93, 45, 23, 96, 98, 63, 57, 60, 70, 77, 75, 19, 111, 112, 78, 116, 36, 85, 69, 121, 44, 74, 127, 56, 131, 135, 50, 89, 137, 30
Offset: 1

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Comments

This permutation is induced when A064216 is restricted to odd numbers (equally, when A064989 is restricted to the numbers of form 4k+1) and the resulting numbers are "ranked" with A246262.

Crossrefs

Inverse: A246265.

Programs

Formula

a(n) = A246262(A064216((2*n)-1)).
a(n) = A246262(A064989((4*n)-3)).

A253888 a(0) = 1; for n >= 1: a(n) = A048673(1+(2*A064216(n))).

Original entry on oeis.org

1, 3, 4, 6, 7, 13, 18, 15, 9, 63, 39, 28, 43, 12, 10, 27, 31, 16, 19, 138, 88, 123, 45, 25, 78, 48, 30, 81, 24, 73, 55, 105, 22, 36, 108, 72, 438, 111, 21, 37, 303, 33, 148, 42, 93, 87, 103, 213, 54, 91, 58, 298, 171, 34, 363, 165, 172, 198, 102, 49, 69, 163, 76, 46, 115, 228, 333, 288, 61, 135, 319, 90, 130, 75, 52
Offset: 0

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Comments

When A048673 is represented as a binary tree, then the node k which contains value n = A048673(k) has as its right child a(n) = A048673(2k+1).

Crossrefs

Same sequence sorted into ascending order: A032766.
Also a permutation of A254049.

Formula

a(0) = 1; for n >= 1: a(n) = A048673(1+(2*A064216(n))).
Also, for n >= 1: a(n) = A254049(1+A064216(n)).

A254116 Permutation of natural numbers: a(n) = A064216(A254103(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 13, 10, 11, 12, 9, 14, 17, 16, 41, 26, 23, 20, 15, 22, 19, 24, 67, 18, 37, 28, 47, 34, 29, 32, 27, 82, 61, 52, 73, 46, 43, 40, 89, 30, 21, 44, 59, 38, 31, 48, 111, 134, 107, 36, 57, 74, 33, 56, 149, 94, 79, 68, 83, 58, 25, 64, 359, 54, 181, 164, 193, 122, 101, 104, 229, 146, 49, 92, 85, 86, 71, 80, 185, 178, 139, 60, 95, 42, 39
Offset: 1

Views

Author

Antti Karttunen, Feb 04 2015

Keywords

Crossrefs

Inverse: A254115.
Fixed points: A254099.
Related permutations: A064216, A254103, A254118.

Programs

  • PARI
    default(primelimit, 2^30);
    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)};
    A064216(n) = A064989((2*n)-1);
    A254103(n) = { if(0==n,0,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2)); };
    A254116(n) = A064216(A254103(n));
    for(n=1, 8192, write("b254116.txt", n, " ", A254116(n)));
    
  • Python
    from sympy import factorint, prevprime, floor
    from operator import mul
    def a064216(n):
        f=factorint(2*n - 1)
        return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f])
    def a254103(n):
        if n==0: return 0
        if n%2==0: return 3*a254103(n/2) - 1
        else: return floor((3*(1 + a254103((n - 1)/2)))/2)
    def a(n): return a064216(a254103(n)) # Indranil Ghosh, Jun 06 2017
  • Scheme
    (define (A254116 n) (A064216 (A254103 n)))
    

Formula

a(n) = A064216(A254103(n)).
Other identities. For all n >= 1:
a(n) = a(2n)/2. [Even bisection halved gives back the sequence itself.]
A254118(n) = (a((2*n)+1) - 1)/2. [Likewise, the odd bisection induces A254118.]

A285705 a(n) = 2*n - A285703(n) = 2*n - A000203(A064216(n)).

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 2, 4, 4, 2, 4, 4, 13, 13, 6, 2, 10, 12, 6, 4, 4, 2, 18, 4, 19, 10, 6, 24, 4, 6, 2, 22, 18, 6, 10, 4, 2, 37, 30, 6, 51, 4, 30, 16, 6, 20, 4, 24, 8, 44, 4, 2, 34, 4, 2, 16, 4, 36, 34, 36, 65, 10, 86, 14, 4, 4, 26, 76, 6, 2, 10, 48, 50, 55, 10, 2, 56, 36, 6, 16, 42, 6, 70, 4, 37, 46, 6, 98, 16, 6, 2, 4, 58, 76, 100, 10, 2, 52, 4, 2, 16, 60, 54
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Comments

Question: Are all terms positive? - Yes, they are, see A286385. (Note added Jul 24 2022).
For listening: fast tempo and percussive instrument, default "modulo 88" pitch mapping, all 10000 terms.

Crossrefs

Programs

  • Mathematica
    Table[2 n - DivisorSigma[1, #] &@ If[n == 1, 1, Apply[Times, FactorInteger[2 n - 1] /. {p_, e_} /; p > 2 :> NextPrime[p, -1]^e]], {n, 103}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    A064989(n) = { my(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); };
    A285705(n) = (n+n - sigma(A064989(n+n-1))); \\ Antti Karttunen, Jul 24 2022
    
  • Scheme
    (define (A285705 n) (- (* 2 n) (A285703 n)))

Formula

a(n) = 2*n - A285703(n) = 2*n - A000203(A064216(n)).
a(n) = 1 + A286385(A064216(n)). - Antti Karttunen, Jul 24 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = 1 - Product_{p prime} (p^3/((p+1)*(p^2-q(p)))) = 0.1831523243..., where q(p) = prevprime(p) (A151799) if p > 2 and q(2) = 1. - Amiram Eldar, Dec 21 2023

A243061 Permutation of natural numbers, a composition of A241909 and A064216: a(n) = A064216(A241909(n)).

Original entry on oeis.org

1, 2, 5, 3, 6, 13, 29, 4, 7, 47, 20, 25, 113, 95, 15, 11, 78, 23, 355, 158, 103, 267, 406, 89, 19, 1247, 17, 1237, 1577, 139, 660, 10, 221, 4363, 67, 38, 8179, 13109, 967, 393, 9266, 515, 21605, 4162, 28, 23601, 19578, 239, 43, 83, 987, 31247
Offset: 1

Views

Author

Antti Karttunen, Jun 02 2014

Keywords

Comments

This is A241909-conjugate of A243065. Please see the comments at the latter sequence.

Crossrefs

Inverse permutation: A243062.

Programs

  • PARI
    A064216(n) = A064989(n+n-1);
    A064989(n) = { my(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) };
    A241909(n) = if(1==n||isprime(n),2^primepi(n),my(f=factor(n),h=1,i,m=1,p=1,k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k,1]); m *= p^(i-h); h = i; if(f[k,2]>1, f[k,2]--, k++)); (p*m));
    A243061(n) = A064216(A241909(n)); \\ Antti Karttunen, Dec 10 2021
  • Scheme
    (define (A243061 n) (A064216 (A241909 n)))
    

Formula

a(n) = A064216(A241909(n)).
a(n) = A241909(A243065(A241909(n))).

A285701 a(n) = number of iterations x -> A064216(x) needed to reach a nonprime number when starting from n, a(2) = a(3) = 1.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Examples

			For n=2, A064216(2) = 2, thus there is exactly one distinct prime that can be reached when iterating A064216 starting from 2, thus a(2) = 1.
For n=19, A064216(19) = 31 (a prime), A064216(31) = 59 (a prime) and A064216(59) = 44 (not a prime), thus there are exactly three distinct primes that are encountered when iterating A064216 starting from 19 before a nonprime is reached, thus a(19) = 3 (the count includes also the starting prime 19).
		

Crossrefs

Cf. A005382 (gives positions of terms > 1 from its third term 7 onward).

Programs

Formula

If A010051(n) = 0 [when n is a nonprime], a(n) = 0, otherwise a(n) = 1 + a(A064216(n)), with a(2) = a(3) = 1.

A285706 a(n) = number of iterations x -> A064216(x) needed to reach a nonprime number when starting from prime(n), a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Comments

Length (or size for the closed cycles: [2] and [3]) of the complete "slipping Cunningham chain of the second kind" starting with prime(n). That is, at the end of every step, the next prime q = 2p-1 "slips" by one step towards smaller primes as A064989(q).
After n = 1, 2 (primes 2 & 3) differs from A181715 for the first time at n=22, where a(22) = 2, while A181715(22) = 3, prime(22) = 79.

Examples

			See examples in A285701.
		

Crossrefs

Cf. A137288 (gives the positions of terms > 1 after its two initial terms).

Programs

  • Mathematica
    Table[If[n <= 2, 1, -1 + Length@ NestWhileList[Apply[Times, FactorInteger[2 # - 1] /. {p_, e_} /; p > 2 :> NextPrime[p, -1]^e] &, Prime@ n, PrimeQ@ # &]], {n, 120}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    A285706(n) = A285701(prime(n)); \\ The rest of code in A285701.
    
  • Scheme
    (define (A285706 n) (A285701 (A000040 n)))

Formula

a(n) = A285701(A000040(n)).

A285704 a(n) = A285703(n) - n = A000203(A064216(n)) - n.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 5, 4, 5, 8, 7, 8, 0, 1, 9, 14, 7, 6, 13, 16, 17, 20, 5, 20, 6, 16, 21, 4, 25, 24, 29, 10, 15, 28, 25, 32, 35, 1, 9, 34, -10, 38, 13, 28, 39, 26, 43, 24, 41, 6, 47, 50, 19, 50, 53, 40, 53, 22, 25, 24, -4, 52, -23, 50, 61, 62, 41, -8, 63, 68, 61, 24, 23, 19, 65, 74, 21, 42, 73, 64, 39, 76, 13, 80, 48, 40, 81, -10, 73, 84, 89, 88, 35, 18, -5
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[-n + DivisorSigma[1, #] &@ If[n == 1, 1, Apply[Times, FactorInteger[2 n - 1] /. {p_, e_} /; p > 2 :> NextPrime[p, -1]^e]], {n, 95}] (* Michael De Vlieger, Apr 26 2017 *)
  • Scheme
    (define (A285704 n) (- (A285703 n) n))

Formula

a(n) = A285703(n) - n = A000203(A064216(n)) - n.
Sum_{k=1..n} a(k) ~ c * n^2, where c = -1/2 + Product_{p prime} (p^3/((p+1)*(p^2-q(p)))) = 0.3168476756..., where q(p) = prevprime(p) (A151799) if p > 2 and q(2) = 1. - Amiram Eldar, Dec 21 2023

A349358 Dirichlet inverse of A064216, which is A064989(2n-1), where A064989 is fully multiplicative with a(2) = 1 and a(p) = prevprime(p) for odd primes p.

Original entry on oeis.org

1, -2, -3, -1, -4, 5, -11, 6, -4, -1, -10, 3, -9, 36, 1, -24, -14, 25, -31, 38, 29, -1, -12, -29, -9, 10, 4, -11, -34, 53, -59, 62, 27, -5, 50, -41, -71, 106, 19, -83, -16, -125, -39, 98, 51, -7, -58, 184, 32, 112, -13, -15, -30, -84, -27, -170, 77, 79, -44, -109, -49, 162, 184, -84, -10, 31, -85, 192, -59, -75, -86
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Crossrefs

Programs

  • PARI
    A064989(n) = { my(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); };
    A064216(n) = A064989((2*n)-1);
    memoA349358 = Map();
    A349358(n) = if(1==n,1,my(v); if(mapisdefined(memoA349358,n,&v), v, v = -sumdiv(n,d,if(dA064216(n/d)*A349358(d),0)); mapput(memoA349358,n,v); (v)));

Formula

a(1) = 1; a(n) = -Sum_{d|n, d < n} A064216(n/d) * a(d).
a(n) = A349359(n) - A064216(n).

A269853 Permutation of natural numbers: a(1) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064216(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 11, 10, 9, 12, 15, 14, 19, 16, 13, 22, 31, 20, 27, 18, 21, 24, 63, 30, 23, 28, 17, 38, 43, 32, 35, 26, 29, 44, 39, 62, 87, 40, 37, 54, 79, 36, 75, 42, 25, 48, 159, 126, 127, 60, 61, 46, 51, 56, 55, 34, 53, 76, 123, 86, 107, 64, 41, 70, 71, 52, 247, 58, 125, 88, 143, 78, 251, 124, 45, 174, 59, 80, 287, 74, 33
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[EvenQ@ n, 2 a[n/2], 1 + 2 a[Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[(n - 1) - 1]]]; Table[a@ n, {n, 83}] (* Michael De Vlieger, Mar 23 2016 *)

Formula

a(1) = 1, after which for even n, a(n) = 2*a(n/2), for odd n, a(n) = 1 + 2*a(A064989(n-2)).
Previous Showing 21-30 of 118 results. Next