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

A117498 Optimal combination of binary and factor methods for finding an addition chain.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 6, 6, 7, 6, 7, 5, 6, 6, 7, 6, 7, 7, 7, 6, 7, 7, 8, 7, 7, 8, 9, 6, 7, 7, 7, 7, 8, 7, 8, 7, 8, 8, 9, 7, 8, 8, 8, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 8, 8, 9, 8, 9, 7, 8, 8, 9, 8, 8, 9, 9, 8, 9, 8, 9, 9, 9, 10, 9, 7, 8, 8, 8, 8, 9, 8, 9, 8, 9
Offset: 1

Views

Author

Keywords

Comments

This is an upper bound for both addition chains (A003313) and A117497. The first few values where A003313 is smaller are 23,43,46,47,59. The first few values where A117497 is smaller are 77,143,154,172,173. The first few values where both are smaller are 77,154,172,173,203.
For a function f from a finite set X to itself, let I(f) be the number of subsets A of X, which are f-stable in the sense that f(A) is contained in A. Then a(n) is the smallest positive integer m, such that a function f exists on a set with m elements, so that I(f) = n. The f-stable subsets form a finite topology on X, which implies that A137813 is a lower bound. The first index where A137813 is smaller is 23. - Qiaochu Yuan, Jun 27 2024

Examples

			a(33)=6 because 6 = 1+a(32) < a(3)+a(11) = 2+5. a(36) = min(a(35)+1, a(2)+a(18), a(3)+a(12), a(4)+a(9), a(6)+a(6)) = min(1+7, 1+5, 2+4, 2+4, 3+3) = 6.
		

Crossrefs

Formula

a(1)=0; a(n) = min(a(n-1)+1, min_{d|n, 1

A137814 Smallest size of a topology that needs at least n points.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 29, 47, 79, 127, 191, 379
Offset: 0

Author

Bridget Tenner, Feb 11 2008

Keywords

Examples

			There is no topology with less than 4 points having 7 open sets. However, there do exist topologies on 3 points that have 2, 3, 4, 5, 6 and 8 open sets.
		

References

  • M. Erné and K. Stege, Counting finite posets and topologies, Tech. Report 236, University of Hannover, 1990.

Crossrefs

Cf. A137813 and A003064 (smallest number which needs an addition chain of at-least-length n).

Extensions

Name improved and a(0), a(1), a(12) added by Achim Flammenkamp, Oct 23 2016

A353058 Minimum number of iterations {add or subtract 1, or half if even} needed to reach 1, starting from n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 7, 6, 7, 6, 6, 5, 6, 6, 7, 6, 7, 7, 7, 6, 7, 7, 8, 7, 8, 7, 7, 6, 7, 7, 8, 7, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 6, 7, 7, 8, 7, 8, 8, 8, 7, 8, 8, 9, 8, 9, 8, 8, 7, 8, 8, 9, 8, 9, 9, 9, 8
Offset: 1

Author

M. F. Hasler, Apr 20 2022

Keywords

Comments

At each iteration, one may choose from one of the three operations: add 1, subtract 1, or, if the number is even, divide by two. a(n) gives the minimum number of iterations required to reach 1, starting from n.
This differs from A003313 (length of shortest addition chain), A128998 (length of shortest addition-subtraction chain) and A137813 (minimal set with n-topology) starting at index n = 27 where a(27) = 7 while the other three have A(27) = 6.

Examples

			For n = 1, the value 1 is already reached, so a(1) = 0 iterations are needed.
For n = 2, one can either subtract 1 or divide by 2 to reach 1, i.e., a(2) = 1 iterations are needed.
For n = 3, one must subtract 1 twice in order to reach the goal 1 in the minimum number of a(3) = 2 steps: Initially, one cannot divide by 2 since 3 is even, and if 1 is added, to get 3 + 1 = 4, at least two divisions by 2 (for a total of 3 steps) would be needed to reach 1.
For n = 7, the fastest is to add 1 (to get 7 + 1 = 8) and then divide three times by 2, to reach 1 in the minimum number of a(7) = 4 steps.
		

Crossrefs

Cf. A003313 (shortest addition chain), A137813 (minimal set with n-topology), A128998 (shortest addition-subtraction chain).

Programs

  • PARI
    apply( {A353058(n,o=[n])=for(i=0,n,o[1]>1||return(i);o=Set(concat([if(n%2,[n-1,n+1],n\2)|n<-o])))}, [1..90])

Formula

log_2(n) <= a(n) <= log_2(n)*3/2.
The maximum of a(n) - log_2(n) is reached for numbers which have the binary expansion {10}*11 or 1{10}*11, where {10}* means any nonzero number of repetitions of '10'.
a(n) = A061339(n)-1. - Rémy Sigrist, Apr 22 2022
Showing 1-3 of 3 results.