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 92 results. Next

A277324 Odd bisection of A260443 (the even terms): a(n) = A260443((2*n)+1).

Original entry on oeis.org

2, 6, 18, 30, 90, 270, 450, 210, 630, 6750, 20250, 9450, 15750, 47250, 22050, 2310, 6930, 330750, 3543750, 1653750, 4961250, 53156250, 24806250, 727650, 1212750, 57881250, 173643750, 18191250, 8489250, 25467750, 2668050, 30030, 90090, 40020750, 1910081250, 891371250, 9550406250, 455814843750, 212713593750
Offset: 0

Views

Author

Antti Karttunen, Oct 10 2016

Keywords

Comments

From David A. Corneth, Oct 22 2016: (Start)
The exponents of the prime factorization of a(n) are first nondecreasing, then nonincreasing.
The exponent of 2 in the prime factorization of a(n) is 1. (End)

Examples

			A method to find terms of this sequence, explained by an example to find a(7). To find k = a(7), we find k such that A048675(k) = 2*7+1 = 15. 7 has the binary partitions: {[7, 0, 0], [5, 1, 0], [3, 2, 0], [1, 3, 0], [3, 0, 1], [1, 1, 1]}. To each of those, we prepend a 1. This gives the binary partitions of 15 starting with a 1. For example, for the first we get [1, 7, 0, 0]. We see that only [1, 5, 1, 0], [1, 3, 2, 0] and [1, 1, 1, 1] start nondecreasing, then nonincreasing, so we only check those. These numbers will be the exponents in a prime factorization. [1, 5, 1, 0] corresponds to prime(1)^1 * prime(2)^5 * prime(3)^1 * prime(4)^0 = 2430. We find that [1, 1, 1, 1] gives k = 210 for which A048675(k) = 15 so a(7) = 210. - _David A. Corneth_, Oct 22 2016
		

Crossrefs

Cf. A277200 (same sequence sorted into ascending order).

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[a[2 n + 1], {n, 0, 38}] (* Michael De Vlieger, Apr 05 2017 *)
  • Python
    from sympy import factorint, prime, primepi
    from operator import mul
    def a003961(n):
        F=factorint(n)
        return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
    def a260443(n): return n + 1 if n<2 else a003961(a260443(n//2)) if n%2==0 else a260443((n - 1)//2)*a260443((n + 1)//2)
    def a(n): return a260443(2*n + 1)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017

Formula

a(n) = A260443((2*n)+1).
a(0) = 2; for n >= 1, a(n) = A260443(n) * A260443(n+1).
Other identities. For all n >= 0:
A007949(a(n)) = A005811(n). [See comments in A125184.]
A156552(a(n)) = A277189(n), a(n) = A005940(1+A277189(n)).
A048675(a(n)) = 2n + 1. - David A. Corneth, Oct 22 2016
A001222(a(n)) = A007306(1+n).
A056169(a(n)) = A284267(n).
A275812(a(n)) = A284268(n).
A248663(a(n)) = A283975(n).
A000188(a(n)) = A283484(n).
A247503(a(n)) = A284563(n).
A248101(a(n)) = A284564(n).
A046523(a(n)) = A284573(n).
a(n) = A277198(n) * A284008(n).
a(n) = A284576(n) * A284578(n) = A284577(n) * A000290(A284578(n)).

Extensions

More linking formulas added by Antti Karttunen, Apr 16 2017

A278243 Filter-sequence for Stern polynomials: Least number with the same prime signature as A260443(n).

Original entry on oeis.org

1, 2, 2, 6, 2, 12, 6, 30, 2, 60, 12, 120, 6, 180, 30, 210, 2, 420, 60, 1080, 12, 2160, 120, 2520, 6, 2520, 180, 7560, 30, 6300, 210, 2310, 2, 4620, 420, 37800, 60, 90720, 1080, 75600, 12, 226800, 2160, 544320, 120, 453600, 2520, 138600, 6, 138600, 2520, 756000, 180, 2268000, 7560, 831600, 30, 415800, 6300, 2079000, 210, 485100, 2310, 30030, 2, 60060, 4620
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence can be used for filtering certain Stern polynomial (see A125184, A260443) related sequences, because it matches only with any such sequence b that can be computed as b(n) = f(A260443(n)), where f(n) is any function that depends only on the prime signature of n (some of these are listed under the index entry for "sequences computed from exponents in ...").
Matching in this context means that the sequence a matches with the sequence b iff for all i, j: a(i) = a(j) => b(i) = b(j). In other words, iff the sequence b partitions the natural numbers to the same or coarser equivalence classes (as/than the sequence a) by the distinct values it obtains.
Some of these are listed on the last line ("Sequences that partition N into ...") of Crossrefs section.

Crossrefs

Sequences that partition or seem to partition N into same or coarser equivalence classes: A002487, A126606, A277314, A277315, A277325, A277326, A277700, A277705.
The following are less certain: A007302 (not proved, but the first 10000 terms match), A072453, A110955 (uncertain, but related to A007302), A218799, A218800.
Note that the base-2 related sequences A069010 and A277561 (= 2^A069010(n)) do not match, although at first it seems so, up to for at least 139 initial terms. Also A028928 belongs to a different family.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]] - Boole[# == 1] &@ a@ n, {n, 0, 66}] (* Michael De Vlieger, May 12 2017 *)
  • Scheme
    (define (A278243 n) (A046523 (A260443 n)))

Formula

a(n) = A046523(A260443(n)).

A277020 Unary-binary representation of Stern polynomials: a(n) = A156552(A260443(n)).

Original entry on oeis.org

0, 1, 2, 5, 4, 13, 10, 21, 8, 45, 26, 93, 20, 109, 42, 85, 16, 173, 90, 477, 52, 957, 186, 733, 40, 749, 218, 1501, 84, 877, 170, 341, 32, 685, 346, 3549, 180, 12221, 954, 7133, 104, 14269, 1914, 49021, 372, 28605, 1466, 5853, 80, 5869, 1498, 30685, 436, 61373, 3002, 23517, 168, 12013, 1754, 24029, 340, 7021, 682, 1365
Offset: 0

Views

Author

Antti Karttunen, Oct 07 2016

Keywords

Comments

Sequence encodes Stern polynomials (see A125184, A260443) with "unary-binary method" where any nonzero coefficient c > 0 is encoded as a run of c 1-bits, separated from neighboring 1-runs by exactly one zero (this follows because A260442 is a subsequence of A073491). See the examples.
Terms which are not multiples of 4 form a subset of A003754, or in other words, each term is 2^k * {a term from a certain subsequence of A247648}, which subsequence remains to be determined.

Examples

			n    Stern polynomial       Encoded as              a(n)
                            "unary-binary" number   (-> decimal)
----------------------------------------------------------------
0    B_0(x) = 0                     "0"               0
1    B_1(x) = 1                     "1"               1
2    B_2(x) = x                    "10"               2
3    B_3(x) = x + 1               "101"               5
4    B_4(x) = x^2                 "100"               4
5    B_5(x) = 2x + 1             "1101"              13
6    B_6(x) = x^2 + x            "1010"              10
7    B_7(x) = x^2 + x + 1       "10101"              21
8    B_8(x) = x^3                "1000"               8
9    B_9(x) = x^2 + 2x + 1     "101101"              45
		

Crossrefs

Cf. A087808 (a left inverse), A156552, A260443, A277189 (odd bisection).

Programs

  • Scheme
    (define (A277020 n) (A156552 (A260443 n)))
    ;; Another implementation, more practical to run:
    (define (A277020 n) (list_of_numbers_to_unary_binary_representation (A260443as_index_lists n)))
    (definec (A260443as_index_lists n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_index_lists (/ n 2)))) (else (add_two_lists (A260443as_index_lists (/ (- n 1) 2)) (A260443as_index_lists (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    (define (list_of_numbers_to_unary_binary_representation nums) (let loop ((s 0) (nums nums) (b 1)) (cond ((null? nums) s) (else (loop (+ s (* (A000225 (car nums)) b)) (cdr nums) (* (A000079 (+ 1 (car nums))) b))))))

Formula

a(n) = A156552(A260443(n)).
Other identities. For all n >= 0:
A087808(a(n)) = n.
A000120(a(n)) = A002487(n).
a(2n) = 2*a(n).
a(2^n) = 2^n.
a(A000225(n)) = A002450(n).

A293217 Restricted growth sequence transform of A293216, where A293216(n) = Product_{d|n, dA260443(d).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 4, 8, 17, 18, 2, 19, 2, 20, 21, 22, 17, 23, 2, 13, 24, 25, 2, 26, 2, 27, 28, 29, 2, 30, 31, 32, 33, 34, 2, 35, 36, 37, 38, 39, 2, 40, 2, 41, 42, 43, 44, 45, 2, 46, 47, 48, 2, 49, 2, 27, 50, 51, 44, 52, 2, 53, 54, 55, 2, 56, 57, 58, 59, 60, 2, 61, 62, 63, 64, 65, 66, 67, 2, 68, 69
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Comments

For all i, j: a(i) = a(j) => A001065(i) = A001065(j).

Crossrefs

Cf. A001065, A260443, A293216, A293215 (a variant).

Programs

  • PARI
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ This function from Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2))));
    A293216(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A260443(d))); m; };
    write_to_bfile(1,rgs_transform(vector(16384,n,A293216(n))),"b293217.txt");

A260442 Sequence A260443 sorted into ascending order.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 18, 19, 23, 29, 30, 31, 35, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 75, 77, 79, 83, 89, 90, 97, 101, 103, 105, 107, 109, 113, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 210, 211, 221, 223, 227, 229, 233, 239, 241, 245, 251, 257, 263, 269, 270, 271, 277, 281, 283, 293, 307, 311
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2015

Keywords

Comments

Each term is a prime factorization encoding of one of the Stern polynomials. See A260443 for details.
Numbers n for which A260443(A048675(n)) = n. - Antti Karttunen, Oct 14 2016

Crossrefs

Subsequence of A073491.
From 2 onward the positions of nonzeros in A277333.
Various subsequences: A000040, A002110, A070826, A277317, A277200 (even terms). Also all terms of A277318 are included here.
Cf. also A277323, A277324 and permutation pair A277415 & A277416.

Programs

  • PARI
    allocatemem(2^30);
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2))));
    isA260442(n) = (A260443(A048675(n)) == n);  \\ The most naive version.
    A055396(n) = if(n==1, 0, primepi(factor(n)[1, 1])) \\ Charles R Greathouse IV, Apr 23 2015
    A061395(n) =  if(1==n, 0, primepi(vecmax(factor(n)[, 1]))); \\ After M. F. Hasler's code for A006530.
    isA260442(n) = ((1==n) || isprime(n) || ((omega(n) == 1+(A061395(n)-A055396(n))) && (A260443(A048675(n)) == n))); \\ Somewhat optimized.
    i=0; n=0; while(i < 10001, n++; if(isA260442(n), write("b260442.txt", i, " ", n); i++));
    \\ Antti Karttunen, Oct 14 2016
    
  • Python
    from sympy import factorint, prime, primepi
    from operator import mul
    from functools import reduce
    def a048675(n):
        F=factorint(n)
        return 0 if n==1 else sum([F[i]*2**(primepi(i) - 1) for i in F])
    def a003961(n):
        F=factorint(n)
        return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
    def a(n): return n + 1 if n<2 else a003961(a(n//2)) if n%2==0 else a((n - 1)//2)*a((n + 1)//2)
    print([n for n in range(301) if a(a048675(n))==n]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A260442 (FIXED-POINTS 0 1 (COMPOSE A260443 A048675)))
    ;; An optimized version:
    (define A260442 (MATCHING-POS 0 1 (lambda (n) (or (= 1 n) (= 1 (A010051 n)) (and (not (< (A001221 n) (+ 1 (A243055 n)))) (= n (A260443 (A048675 n))))))))
    ;; Antti Karttunen, Oct 14 2016
    

A277198 a(n) = gcd(A260443(n), A260443(n+1)).

Original entry on oeis.org

1, 1, 3, 1, 1, 3, 15, 1, 1, 15, 15, 5, 5, 15, 105, 1, 1, 105, 75, 5, 5, 375, 525, 7, 7, 525, 525, 35, 35, 105, 1155, 1, 1, 1155, 525, 245, 35, 2625, 18375, 7, 7, 91875, 13125, 35, 245, 18375, 40425, 11, 11, 40425, 25725, 245, 245, 128625, 202125, 77, 77, 40425, 40425, 385, 385, 1155, 15015, 1, 1, 15015, 5775, 2695, 2695, 1414875, 1414875, 77, 77
Offset: 0

Views

Author

Antti Karttunen, Oct 10 2016

Keywords

Crossrefs

Cf. A277327, A277328 (number of prime factors).

Programs

  • PARI
    A=[];
    A003961(n)=my(f=factor(n)); f[, 1] = apply(p->nextprime(p+1), f[, 1]); factorback(f)
    A260443(n)=if(n<3, return(n+1)); if(#AA260443(n\2)*A260443(n\2+1), A003961(A260443(n/2)))
    a(n)=gcd(A260443(n), A260443(n+1)) \\ Charles R Greathouse IV, Oct 13 2016
  • Scheme
    (define (A277198 n) (gcd (A260443 (+ 1 n)) (A260443 n)))
    ;; A more practical version, needing only an implementation of A000040:
    (define (A277198 n) (product_primes_to_kth_powers (gcd_of_exp_lists (A260443as_coeff_list n) (A260443as_coeff_list (+ 1 n)))))
    (define (product_primes_to_kth_powers nums) (let loop ((p 1) (nums nums) (i 1)) (cond ((null? nums) p) (else (loop (* p (expt (A000040 i) (car nums))) (cdr nums) (+ 1 i))))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    (define (gcd_of_exp_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (gcd_of_exp_lists nums2 nums1)) (else (map min nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    

Formula

a(n) = gcd(A260443(n), A260443(n+1)).

A293216 a(n) = Product_{d|n, dA260443(d).

Original entry on oeis.org

1, 2, 2, 6, 2, 36, 2, 30, 12, 108, 2, 2700, 2, 180, 216, 210, 2, 48600, 2, 40500, 360, 1620, 2, 661500, 36, 2700, 1080, 94500, 2, 153090000, 2, 2310, 3240, 3780, 1080, 4465125000, 2, 40500, 5400, 69457500, 2, 34445250000, 2, 21262500, 4082400, 56700, 2, 560290500, 60, 127575000, 7560, 49612500, 2, 1205583750000, 9720, 254677500, 81000, 132300, 2
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Crossrefs

Cf. A048675, A260443, A293217 (restricted growth sequence transform), A293214 (a variant).
Cf. also A001065, A091954.

Programs

Formula

a(n) = Product_{d|n, dA260443(d).
For all n >= 0, a(2^n) = A002110(n).
For all n >= 1, A007814(a(n)) = A091954(n) and A048675(a(n)) = A001065(n).

A277328 Number of primes (counted with multiplicity) dividing gcd(A260443(n), A260443(n+1)): a(n) = A001222(A277198(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 13 2016

Keywords

Crossrefs

Programs

  • Scheme
    (define (A277328 n) (A001222 (A277198 n)))
    ;; A standalone implementation:
    (define (A277328 n) (reduce + 0 (gcd_of_exp_lists (A260443as_coeff_list n) (A260443as_coeff_list (+ 1 n)))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    (define (gcd_of_exp_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (gcd_of_exp_lists nums2 nums1)) (else (map min nums1 (append nums2 (make-list (- len1 len2) 0)))))))

Formula

a(n) = A001222(A277198(n)).
a(n) >= A277327(n).

A277333 Left inverse of A260443, giving 0 as a result when n is outside of the range of A260443.

Original entry on oeis.org

0, 1, 2, 0, 4, 3, 8, 0, 0, 0, 16, 0, 32, 0, 6, 0, 64, 5, 128, 0, 0, 0, 256, 0, 0, 0, 0, 0, 512, 7, 1024, 0, 0, 0, 12, 0, 2048, 0, 0, 0, 4096, 0, 8192, 0, 0, 0, 16384, 0, 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 65536, 0, 131072, 0, 0, 0, 0, 0, 262144, 0, 0, 0, 524288, 0, 1048576, 0, 10, 0, 24, 0, 2097152, 0, 0, 0, 4194304, 0, 0, 0, 0, 0, 8388608, 9
Offset: 1

Views

Author

Antti Karttunen, Oct 10 2016

Keywords

Examples

			a(1) = 0 because A260443(0) = 1. For n > 1, a(n) = 0 only if n does not occur in the range of A260443.
a(6) = 3 because A260443(3) = 6.
		

Crossrefs

Cf. A277316, A260442 (from 2 onward, the positions of nonzeros), A277317 (positions of primes).

Programs

Formula

If A260443(A048675(n)) = n, then a(n) = A048675(n), otherwise a(n) = 0.
Other identities. For all n >= 0:
a(A260443(n)) = n.
a(2n+1) = 2*a(A064989(2n+1)).
If a(2n) > 0 [by necessity an odd number in that case], then A005811((a(2n)-1)/2) = A007949(2n). [See comment in A277324.]

A276081 a(n) = A276075(A260443(n)).

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 8, 9, 24, 11, 14, 13, 30, 17, 32, 33, 120, 35, 38, 25, 54, 27, 44, 43, 144, 47, 62, 49, 150, 65, 152, 153, 720, 155, 158, 73, 174, 63, 92, 79, 264, 81, 98, 71, 198, 87, 188, 187, 840, 191, 206, 109, 294, 111, 212, 199, 864, 215, 302, 217, 870, 305, 872, 873, 5040, 875, 878, 313, 894, 231, 332, 247, 984, 237, 266, 155, 438, 171
Offset: 0

Views

Author

Antti Karttunen, Aug 18 2016

Keywords

Crossrefs

Programs

  • Python
    from sympy import factorint, factorial as f, prime, primepi
    from operator import mul
    from functools import reduce
    def a003961(n):
        F=factorint(n)
        return 1 if n==1 else reduce(mul, [prime(primepi(i) + 1)**F[i] for i in F])
    def a260443(n): return n + 1 if n<2 else a003961(a260443(n//2)) if n%2==0 else a260443((n - 1)//2)*a260443((n + 1)//2)
    def a276075(n):
        F=factorint(n)
        return 0 if n==1 else sum([F[i]*f(primepi(i)) for i in F])
    def a(n): return a276075(a260443(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    (define (A276081 n) (A276075 (A260443 n)))
    ;; A more practical standalone program, that uses memoization-macro definec:
    (define (A276081 n) (sum_factorials_times_elements_in (A260443as_index_lists n)))
    (definec (A260443as_index_lists n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_index_lists (/ n 2)))) (else (add_two_lists (A260443as_index_lists (/ (- n 1) 2)) (A260443as_index_lists (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    (define (sum_factorials_times_elements_in nums) (let loop ((s 0) (nums nums) (i 2) (f 1)) (cond ((null? nums) s) (else (loop (+ s (* (car nums) f)) (cdr nums) (+ 1 i) (* i f))))))
    

Formula

a(n) = A276075(A260443(n)).
Showing 1-10 of 92 results. Next