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-10 of 25 results. Next

A322872 Ordinal transform of A171462, where A171462(n) = n - A052126(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 29 2018

Keywords

Crossrefs

Programs

  • Mathematica
    A171462[n_] := If[n == 1, 0, Module[{f = FactorInteger[n], p},
         p = f[[-1, 1]]; n(p-1)/p]];
    b[_] = 0;
    a[n_] := a[n] = With[{t = A171462[n]}, b[t] = b[t]+1];
    Array[a, 105] (* Jean-François Alcover, Dec 21 2021 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    v322872 = ordinal_transform(vector(up_to,n,A171462(n)));
    A322872(n) = v322872[n];

A052126 a(1) = 1; for n>1, a(n)=n/(largest prime dividing n).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 3, 2, 1, 4, 1, 2, 3, 8, 1, 6, 1, 4, 3, 2, 1, 8, 5, 2, 9, 4, 1, 6, 1, 16, 3, 2, 5, 12, 1, 2, 3, 8, 1, 6, 1, 4, 9, 2, 1, 16, 7, 10, 3, 4, 1, 18, 5, 8, 3, 2, 1, 12, 1, 2, 9, 32, 5, 6, 1, 4, 3, 10, 1, 24, 1, 2, 15, 4, 7, 6, 1, 16, 27, 2, 1, 12, 5, 2, 3, 8, 1, 18, 7, 4, 3, 2, 5, 32, 1
Offset: 1

Views

Author

James Sellers, Jan 21 2000

Keywords

Comments

For n>1, a(n)=1 if and only if n is prime. - Zak Seidov, Feb 09 2015
For n > 1, a(n) is the smallest divisor of n such that n/a(n) is prime. - David James Sycamore, Jan 03 2024

Examples

			a(15) = 15/(largest prime dividing 15) = 15/5 = 3.
		

Crossrefs

Left inverse of A253560.

Programs

  • Maple
    a := n -> `if`(n=1, 1, n/max(numtheory[factorset](n)));
    seq(a(n), n=1..97); # Peter Luschny, Jul 28 2014
  • Mathematica
    a052126[n_] := Array[If[n == 1, 1, #/FactorInteger[#][[-1]][[1]]] &, n]; a052126[97] (* Michael De Vlieger, Dec 21 2014 *)
  • PARI
    gpf(n)=my(f=factor(n)[,1]); f[#f]
    a(n)=if(n<4,return(1)); n/gpf(n) \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = n/A006530(n).
a(n) = A130065(n)/A020639(n). - Reinhard Zumkeller, May 05 2007
a(A002110(n)) = A002110(n-1), a(p^k) = p^(k-1), p any prime; k >= 1. - David James Sycamore, Jan 03 2024
a(n) = n - A171462(n). - Antti Karttunen, Jan 04 2024

A060681 Largest difference between consecutive divisors of n (ordered by size).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

Is a(n) the least m > 0 such that n - m divides n! + m? - Clark Kimberling, Jul 28 2012
Is a(n) the least m > 0 such that L(n-m) divides L(n+m), where L = A000032 (Lucas numbers)? - Clark Kimberling, Jul 30 2012
Records give A006093. - Omar E. Pol, Oct 26 2013
Divide n by its smallest prime factor p, then multiply with (p-1), with a(1) = 0 by convention. Compare also to A366387. - Antti Karttunen, Oct 23 2023
a(n) is also the smallest LCM of positive integers x and y where x + y = n. - Felix Huber, Aug 28 2024

Examples

			For n = 35, divisors are {1, 5, 7, 35}; differences are {4, 2, 28}; a(35) = largest difference = 28 = 35 - 35/5.
		

Crossrefs

Cf. A013661, A020639, A060680, A060682, A060683, A060685, A064097 (number of iterations needed to reach 1).
Cf. also A171462, A366387.

Programs

  • Haskell
    a060681 n = div n p * (p - 1) where p = a020639 n
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Maple
    read("transforms") :
    A060681 := proc(n)
        if n = 1 then
            0 ;
        else
            sort(convert(numtheory[divisors](n),list)) ;
            DIFF(%) ;
            max(op(%)) ;
        end if;
    end proc:
    seq(A060681(n),n=1..60) ; # R. J. Mathar, May 23 2018
    # second Maple program:
    A060681:=n->if(n=1,0,min(map(x->ilcm(x,n-x),[$1..1/2*n]))); seq(A060681(n),n=1..74); # Felix Huber, Aug 28 2024
  • Mathematica
    a[n_ ] := n - n/FactorInteger[n][[1, 1]]
    Array[Max[Differences[Divisors[#]]] &, 80, 2] (* Harvey P. Dale, Oct 26 2013 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i])
    a(n)=vecmax(diff(divisors(n))) \\ Charles R Greathouse IV, Sep 02 2015
    
  • PARI
    a(n) = if (n==1, 0, n - n/factor(n)[1,1]); \\ Michel Marcus, Oct 24 2015
    
  • PARI
    first(n) = n = max(n, 1); my(res = vector(n)); res[1] = 0; forprime(p = 2, n, for(i = 1, n \ p, if(res[p * i] == 0, res[p * i] = i*(p-1)))); res \\ David A. Corneth, Jan 08 2019
    
  • Python
    from sympy import primefactors
    def A060681(n): return n-n//min(primefactors(n),default=1) # Chai Wah Wu, Jun 21 2023

Formula

a(n) = n - n/A020639(n).
a(n) = n - A032742(n). - Omar E. Pol, Aug 31 2011
a(2n) = n, a(3*(2n+1)) = 2*(2n+1) = 4n + 2. - Antti Karttunen, Oct 23 2023
Sum_{k=1..n} a(k) ~ (1/2 - c) * n^2, where c is defined in the corresponding formula in A032742. - Amiram Eldar, Dec 21 2024

Extensions

Edited by Dean Hickerson, Jan 22 2002
a(1)=0 added by N. J. A. Sloane, Oct 01 2015 at the suggestion of Antti Karttunen

A329697 a(n) is the number of iterations needed to reach a power of 2 starting at n and using the map k -> k-(k/p), where p is the largest prime factor of k.

Original entry on oeis.org

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

Views

Author

Ali Sada and Robert G. Wilson v, Feb 28 2020

Keywords

Comments

From Antti Karttunen, Apr 07 2020: (Start)
Also the least number of iterations of nondeterministic map k -> k-(k/p) needed to reach a power of 2, when any prime factor p of k can be used. The minimal length path to the nearest power of 2 (= 2^A064415(n)) is realized whenever one uses any of the A005087(k) distinct odd prime factors of the current k, at any step of the process. For example, this could be done by iterating with the map k -> k-(k/A078701(k)), i.e., by using the least odd prime factor of k (instead of the largest prime).
Proof: Viewing the prime factorization of changing k as a multiset ("bag") of primes, we see that liquefying any odd prime p with step p -> (p-1) brings at least one more 2 to the bag, while applying p -> (p-1) to any 2 just removes it from the bag, but gives nothing back. Thus the largest (and thus also the nearest) power of 2 is reached by eliminating - step by step - all odd primes from the bag, but none of 2's, and it doesn't matter in which order this is done.
The above implies also that the sequence is totally additive, which also follows because both A064097 and A064415 are. That A064097(n) = A329697(n) + A054725(n) for all n > 1 can be also seen by comparing the initial conditions and the recursion formulas of these three sequences.
For any n, A333787(n) is either the nearest power of 2 reached (= 2^A064415(n)), or occurs on some of the paths from n to there.
(End)
A003401 gives the numbers k where a(k) = A005087(k). See also A336477. - Antti Karttunen, Mar 16 2021

Examples

			The trajectory of 15 is {12, 8}, taking 2 iterations to reach 8 = 2^3. So a(15) is 2.
From _Antti Karttunen_, Apr 07 2020: (Start)
Considering all possible paths from 15 to 1 nondeterministic map k -> k-(k/p), where p can be any prime factor of k, we obtain the following graph:
        15
       / \
      /   \
    10     12
    / \   / \
   /   \ /   \
  5     8     6
   \__  |  __/|
      \_|_/   |
        4     3
         \   /
          \ /
           2
           |
           1.
It can be seen that there's also alternative route to 8 via 10 (with 10 = 15-(15/3), where 3 is not the largest prime factor of 15), but it's not any shorter than the route via 12.
(End)
		

Crossrefs

Cf. A000079, A334101, A334102, A334103, A334104, A334105, A334106 for positions of 0 .. 6 in this sequence, and also array A334100.
Cf. A334099 (a right inverse, positions of the first occurrence of each n).
Cf. A334091 (first differences), A335429 (partial sums).
Cf. also A331410 (analogous sequence when using the map k -> k + k/p), A334861, A335877 (their sums and differences), see also A335878 and A335884, A335885.

Programs

  • Mathematica
    a[n_] := Length@ NestWhileList[# - #/FactorInteger[#][[-1, 1]] &, n, # != 2^IntegerExponent[#, 2] &] -1; Array[a, 100]
  • PARI
    A329697(n) = if(!bitand(n,n-1),0,1+A329697(n-(n/vecmax(factor(n)[, 1])))); \\ Antti Karttunen, Apr 07 2020
    
  • PARI
    up_to = 2^24;
    A329697list(up_to) = { my(v=vector(up_to)); v[1] = 0; for(n=2, up_to, v[n] = if(!bitand(n,n-1),0,1+vecmin(apply(p -> v[n-n/p], factor(n)[, 1]~)))); (v); };
    v329697 = A329697list(up_to);
    A329697(n) = v329697[n]; \\ Antti Karttunen, Apr 07 2020
    
  • PARI
    A329697(n) = if(n<=2,0, if(isprime(n), A329697(n-1)+1, my(f=factor(n)); (apply(A329697, f[, 1])~ * f[, 2]))); \\ Antti Karttunen, Apr 19 2020

Formula

From Antti Karttunen, Apr 07-19 2020: (Start)
a(1) = a(2) = 0; and for n > 2, a(p) = 1 + a(p-1) if p is an odd prime and a(n*m) = a(n) + a(m) if m,n > 1. [This is otherwise equal to the definition of A064097, except here we have a different initial condition, with a(2) = 0].
a(2n) = a(A000265(n)) = a(n).
a(p) = 1+a(p-1), for all odd primes p.
If A209229(n) == 1 [when n is a power of 2], a(n) = 0,
otherwise a(n) = 1 + a(n-A052126(n)) = 1 + a(A171462(n)).
Equivalently, for non-powers of 2, a(n) = 1 + a(n-(n/A078701(n))),
or equivalently, for non-powers of 2, a(n) = 1 + Min a(n - n/p), for p prime and dividing n.
a(n) = A064097(n) - A064415(n), or equally, a(n) = A064097(n) - A054725(n), for n > 1.
a(A019434(n)) = 1, a(A334092(n)) = 2, a(A334093(n)) = 3, etc. for all applicable n.
For all n >= 0, a(A334099(n)) = a(A000244(n)) = a(A000351(n)) = a(A001026(n)) = a(257^n) = a(65537^n) = n.
a(A122111(n)) = A334107(n), a(A225546(n)) = A334109(n).
(End)
From Antti Karttunen, Mar 16 2021: (Start)
a(n) = a(A336466(n)) + A087436(n) = A336396(n) + A087436(n).
a(A053575(n)) = A336469(n) = a(n) - A005087(n).
a(A147545(n)) = A000120(A147545(n)) - 1.
(End)

A335885 The length of a shortest path from n to a power of 2, when applying the nondeterministic maps k -> k - k/p and k -> k + k/p, where p can be any of the odd prime factors of k, and the maps can be applied in any order.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Comments

The length of a shortest path from n to a power of 2, when using the transitions x -> A171462(x) and x -> A335876(x) in any order.
a((2^e)-1) is equal to A046051(e) = A001222((2^e)-1) when e is either a Mersenne exponent (in A000043), or some other number: 1, 4, 6, 8, 16, 32. For example, 32 is present because 2^32 - 1 = 4294967295 = 3*5*17*257*65537, a squarefree product of five known Fermat primes. - Antti Karttunen, Aug 11 2020

Examples

			A335876(67) = 68, and A171462(68) = 64 = 2^6, and this is the shortest path from 67 to a power of 2, thus a(67) = 2.
A171462(15749) = 15748, A335876(15748) = 15872, A335876(15872) = 16384 = 2^14, and this is the shortest path from 15749 to a power of 2, thus a(15749) = 3.
		

Crossrefs

Cf. A000079, A335911, A335912 (positions of 0's, 1's and 2's in this sequence) and array A335910.

Programs

  • PARI
    A335885(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+min(A335885(f[k,1]-1),A335885(f[k,1]+1))))); };
    
  • PARI
    \\ Or empirically as:
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    A335876(n) = if(1==n,2,(n+(n/vecmax(factor(n)[, 1]))));
    A209229(n) = (n && !bitand(n,n-1));
    A335885(n) = if(A209229(n),0,my(xs=Set([n]),newxs,a,b,u); for(k=1,oo, newxs=Set([]); for(i=1,#xs,u = xs[i]; a = A171462(u); if(A209229(a), return(k)); b = A335876(u); if(A209229(b), return(k)); newxs = setunion([a],newxs); newxs = setunion([b],newxs)); xs = newxs));

Formula

Fully additive with a(2) = 0, and a(p) = 1+min(a(p-1), a(p+1)), for odd primes p.
For all n >= 1, a(n) <= A335875(n) <= A335881(n) <= A335884(n) <= A335904(n).
For all n >= 0, a(A000244(n)) = n, and these also seem to give records.

A064415 a(1) = 0, a(n) = iter(n) if n is even, a(n) = iter(n)-1 if n is odd, where iter(n) = A003434(n) = smallest number of iterations of Euler totient function phi needed to reach 1.

Original entry on oeis.org

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

Views

Author

Christian WEINSBERG (cweinsbe(AT)fr.packardbell.org), Sep 30 2001

Keywords

Comments

a(n) is the exponent of the eventual power of 2 reached when starting from k=n and then iterating the nondeterministic map k -> k-(k/p), where p can be any odd prime factor of k, for example, the largest. Note that each original odd prime factor p of n brings its own share of 2's to the final result after it has been completely processed (with all intermediate odd primes also eliminated, leaving only 2's). As no 2's are removed, also all 2's already present in the original n are included in the eventual power of 2 that is reached, implying that a(n) >= A007814(n). - Antti Karttunen, May 13 2020

Crossrefs

The 2-adic valuation of A309243.
Partial sums of A334195. Cf. A053044 for partial sums of this sequence.
Cf. also A334097 (analogous sequence when using the map k -> k + k/p).

Programs

Formula

For all integers m >0 and n>0 a(m*n)=a(m)+a(n). The function a(n) is completely additive. The smallest integer q which satisfy the equation a(q)=n is 2^q, the greatest is 3^q. For all integers n>0, the counter image off n, a^-1(n) is finite.
a(1) = 0 and a(n) = A054725(n) for n>=2. - Joerg Arndt, Apr 08 2014, A-number corrected by Antti Karttunen, May 13 2020
From Antti Karttunen, May 13 2020: (Start)
For n > 1, a(n) = A003434(n) - A000035(n).
a(1) = 0, a(2) = 1 and for n > 2, a(n) = sum(p | n, a(p-1)), where sum is over all primes p that divide n, with multiplicity. (Cf. A054725).
a(1) = 0, a(2) = 1 and a(p) = 1 + a((p-1)/2) if p is an odd prime and a(n*m) = a(n) + a(m) if m,n > 1. [From above formula, 1+ compensates for the "lost" 2]
a(n) = A007814(A309243(n)). [From Rémy Sigrist's conjecture in the latter sequence. This reduces to a(n) = sum(p|n, a(p-1)) formula above, thus holds also]
If A209229(n) = 1 [when n is a power of 2], a(n) = A007814(n), otherwise a(n) = a(n-A052126(n)) = a(A171462(n)). [From the definition in the comments]
a(n) = A064097(n) - A329697(n).
a(2^k) = a(3^k) = k.
(End)

Extensions

More terms from David Wasserman, Jul 22 2002
Definition corrected by Reinhard Zumkeller, Sep 18 2011

A334092 Primes p of the form of the form q*2^h + 1, where q is one of the Fermat primes; Primes p for which A329697(p) == 2.

Original entry on oeis.org

7, 11, 13, 41, 97, 137, 193, 641, 769, 12289, 40961, 163841, 557057, 786433, 167772161, 2281701377, 3221225473, 206158430209, 2748779069441, 6597069766657, 38280596832649217, 180143985094819841, 221360928884514619393, 188894659314785808547841, 193428131138340667952988161
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2020

Keywords

Comments

Primes p such that p-1 is not a power of two, but for which A171462(p-1) = (p-1-A052126(p-1)) is [a power of 2].
Primes of the form ((2^(2^k))+1)*2^h + 1, where ((2^(2^k))+1) is one of the Fermat primes, A019434, 3, 5, 17, 257, ..., .

Crossrefs

Primes in A334102.
Intersection of A081091 and A147545.
Subsequences: A039687, A050526, A300407.

Programs

  • PARI
    isA334092(n) = (isprime(n)&&2==A329697(n));
    
  • PARI
    A052126(n) = if(1==n,n,n/vecmax(factor(n)[, 1]));
    A209229(n) = (n && !bitand(n,n-1));
    isA334092(n) = (isprime(n)&&(!A209229(n-1))&&A209229(n-1-A052126(n-1)));
    
  • PARI
    list(lim)=if(exponent(lim\=1)>=2^33, error("Verify composite character of more Fermat primes before checking this high")); my(v=List(),t); for(e=0,4, t=2^2^e+1; while((t<<=1)Charles R Greathouse IV, Apr 14 2020

Extensions

More terms from Giovanni Resta, Apr 14 2020

A334102 Numbers n for which A329697(n) == 2.

Original entry on oeis.org

7, 9, 11, 13, 14, 15, 18, 22, 25, 26, 28, 30, 36, 41, 44, 50, 51, 52, 56, 60, 72, 82, 85, 88, 97, 100, 102, 104, 112, 120, 137, 144, 164, 170, 176, 193, 194, 200, 204, 208, 224, 240, 274, 288, 289, 328, 340, 352, 386, 388, 400, 408, 416, 448, 480, 548, 576, 578, 641, 656, 680, 704, 769, 771, 772, 776, 800, 816, 832, 896, 960, 1096
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2020

Keywords

Comments

Numbers n for which A171462(n) = n-A052126(n) is in A334101.
Numbers k such that A000265(k) is either in A333788 or in A334092.
Each term is either of the form A334092(n)*2^k, for some n >= 1, and k >= 0, or a product of two terms of A334101, whether distinct or not.
Binary weight (A000120) of these terms is always either 2, 3 or 4. It is 2 for those terms that are of the form 9*2^k, 4 for the terms of the form p*q*2^k, where p and q are two distinct Fermat primes (A019434), and 3 for the both terms of the form A334092(n)*2^k, and for the terms of the form (p^2)*(2^k), where p is a Fermat prime > 3.

Crossrefs

Row 2 of A334100.
Cf. A333788 (a subsequence), A334092 (primes present), A334093 (primes that are 1 + some term in this sequence).
Squares of A334101 form a subsequence of this sequence. Squares of these numbers can be found (as a subset) in A334104, and the cubes in A334106.

Programs

A334101 Numbers of the form q*(2^k), where q is one of the Fermat primes and k >= 0; Numbers n for which A329697(n) == 1.

Original entry on oeis.org

3, 5, 6, 10, 12, 17, 20, 24, 34, 40, 48, 68, 80, 96, 136, 160, 192, 257, 272, 320, 384, 514, 544, 640, 768, 1028, 1088, 1280, 1536, 2056, 2176, 2560, 3072, 4112, 4352, 5120, 6144, 8224, 8704, 10240, 12288, 16448, 17408, 20480, 24576, 32896, 34816, 40960, 49152, 65537, 65792, 69632, 81920, 98304, 131074, 131584, 139264
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2020

Keywords

Comments

Numbers k that themselves are not powers of two, but for which A171462(k) = k-A052126(k) is [a power of 2].
Numbers k such that A000265(k) is in A019434.
Squares of these numbers can be found (as a subset) in A334102, and the cubes (as a subset) in A334103.

Crossrefs

Row 1 of A334100.
Cf. A019434 (primes present), A007283, A020714, A110287 (other subsequences).
Subsequence of A018900.

Programs

Formula

For all n, A000120(a(n)) = 2.

A335884 The length of a longest path from n to a power of 2, when applying the nondeterministic maps k -> k - k/p and k -> k + k/p, where p can be any of the odd prime factors of k, and the maps can be applied in any order.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Comments

The length of a longest path from n to a power of 2, when using the transitions x -> A171462(x) and x -> A335876(x).

Crossrefs

Cf. A335883 (position of the first occurrence of each n).

Programs

  • PARI
    A335884(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+max(A335884(f[k,1]-1),A335884(f[k,1]+1))))); };
    
  • PARI
    \\ Or empirically as:
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    A335876(n) = if(1==n,2,(n+(n/vecmax(factor(n)[, 1]))));
    A209229(n) = (n && !bitand(n,n-1));
    A335884(n) = if(A209229(n),0,my(xs=Set([n]),newxs,a,b,u); for(k=1,oo, newxs=Set([]); if(!#xs, return(k-1)); for(i=1,#xs,u = xs[i]; a = A171462(u); if(!A209229(a), newxs = setunion([a],newxs)); b = A335876(u); if(!A209229(b), newxs = setunion([b],newxs))); xs = newxs));

Formula

Fully additive with a(2) = 0, and a(p) = 1+max(a(p-1), a(p+1)), for odd primes p.
For all n >= 1, A335904(n) >= a(n) >= A335881(n) >= A335875(n) >= A335885(n).
For all n >= 0, a(A335883(n)) = n.
Showing 1-10 of 25 results. Next