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

A229624 Positive integers k for which the length of shortest addition-subtraction chain is smaller than the length of shortest addition chain, i.e., A128998(k) < A003313(k).

Original entry on oeis.org

31, 47, 62, 63, 71, 79, 93, 94, 95, 124, 126, 127, 139, 141, 142, 143, 155, 157, 158, 159, 186, 188, 189, 190, 191, 223, 235, 237, 239, 247, 248, 251, 252, 253, 254, 255, 263, 271, 278, 279, 282, 283, 284, 285, 286, 287, 310, 314, 315, 316, 317, 318, 319, 372
Offset: 1

Views

Author

Max Alekseyev, Sep 27 2013

Keywords

Crossrefs

Extensions

More terms from Jinyuan Wang, Apr 17 2025

A230697 Length of shortest addition-multiplication chain for n.

Original entry on oeis.org

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

Views

Author

Harry Altman, Oct 27 2013

Keywords

Examples

			A shortest addition-multiplication chain for 16 is (1,2,4,16), of length a(16) = 3.
A shortest addition-multiplication chain for 281 is (1,2,4,5,16,25,256,281), of length a(281) = 7. This is the first case where not all terms in some shortest chain are the sum or product of the immediately preceding term and one more preceding term. In other words, 281 is the smallest of the analog of non-Brauer numbers (A349044) for addition-multiplication chains. The next ones are 913, 941, 996, 997, 998, 1012, 1077, 1079, 1542, 1572, 1575, 1589, 1706, 1792, 1795, 1816, 1864, ... . - _Pontus von Brömssen_, May 02 2025
		

Crossrefs

A383335 Length of shortest addition-multiplication-exponentiation chain for n.

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Apr 27 2025

Keywords

Comments

An addition-multiplication-exponentiation chain for n is a finite sequence of numbers, starting with 1 and ending with n, in which each element except 1 equals x+y, x*y, or x^y for two preceding elements x and y (not necessarily distinct). The length of the chain is the number of elements in the chain, excluding 1.

Examples

			a(248) = 5 because the shortest addition-multiplication-exponentiation chain for 248 has length 5: (1, 2, 3, 5, 243, 248).
		

Crossrefs

A383142 Smallest positive integer with shortest addition-subtraction chain of length n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 29, 53, 87, 151, 267, 461, 811, 1383, 2357, 4277, 7499, 14003, 25931, 44269, 87773, 152947, 271563
Offset: 0

Views

Author

Jinyuan Wang, Apr 17 2025

Keywords

Examples

			a(8) = 53 because 53 is the smallest positive integer k such that A128998(k) = 8. An example of a shortest addition-subtraction chain for 53 is (1 2 3 4 7 14 25 28 53). a(8) > A003064(8) because an optimal chain for A003064(8) = 47 has length 7: (1 2 3 6 12 24 23 47).
		

Crossrefs

Formula

a(n) >= A003064(n).

A383143 Number of positive integers with a shortest addition-subtraction chain of length n.

Original entry on oeis.org

1, 1, 2, 3, 5, 9, 16, 28, 49, 88, 156, 280, 499, 904, 1639, 2986, 5442, 9936, 18134
Offset: 0

Views

Author

Jinyuan Wang, Apr 17 2025

Keywords

Examples

			a(6) = 16 because the number of occurrences of 6 in A128998 is 16. These numbers are 19, 21, 22, 23, 25, 26, 27, 28, 30, 31, 33, 34, 36, 40, 48, 64.
		

Crossrefs

Formula

a(n) >= A003065(n).

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

Views

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