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

A135499 Numbers for which Sum_digits(odd positions) = Sum_digits(even positions).

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198, 220, 231, 242, 253, 264, 275, 286, 297, 330, 341, 352, 363, 374, 385, 396, 440, 451, 462, 473, 484, 495, 550, 561, 572, 583, 594, 660, 671, 682, 693, 770, 781, 792, 880, 891, 990
Offset: 1

Views

Author

Keywords

Comments

Conjecture: this is a subsequence of A008593 (verified for the first 50 thousand terms). - R. J. Mathar, Feb 10 2008
Subsequence of A008593. - Zak Seidov Feb 11 2008
If k is present, so is 10*k. - Robert G. Wilson v, Jul 13 2014
As Seidov said, a subsequence of multiples of 11. That follows trivially from the divisibility rule for 11. - Jens Kruse Andersen, Jul 13 2014
A225693(a(n)) = 0. - Reinhard Zumkeller, Aug 08 2014

Examples

			594, 1023, and 1397 are terms:
   594 -> 4 + 5 = 9;
  1023 -> 3 + 0 = 2 + 1;
  1397 -> 7 + 3 = 9 + 1.
		

Crossrefs

Cf. A060979.
Cf. A225693.

Programs

  • Haskell
    a135499 n = a135499_list !! (n-1)
    a135499_list = filter ((== 0) . a225693) [1..]
    -- Reinhard Zumkeller, Aug 08 2014, Jul 05 2014
  • Maple
    P:=proc(n) local i,k,w,x; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; x:=0; k:=i; while k>0 do x:=x+(k-(trunc(k/10)*10)); k:=trunc(k/100); od; if w=2*x then print(i); fi; od; end: P(3000);
    # Alternative:
    filter:= proc(n)
    local L,d;
    L:= convert(n,base,10);
    d:= nops(L);
    add(L[2*i],i=1..floor(d/2)) = add(L[2*i-1],i=1..floor((d+1)/2))
    end proc:
    select(filter,[ 11*j $ j= 1 .. 10^4 ]); # Robert Israel, May 28 2014
  • Mathematica
    dQ[n_]:=Module[{p=Transpose[Partition[IntegerDigits[n],2,2,1,0]]},Total[First[p]]== Total[Last[p]]]; Select[Range[1000],dQ] (* Harvey P. Dale, May 26 2011 *)

A329719 Numbers whose digits can be partitioned into at least 3 segments (not beginning with 0) where each segment is the sum of the previous two segments.

Original entry on oeis.org

112, 123, 134, 145, 156, 167, 178, 189, 213, 224, 235, 246, 257, 268, 279, 314, 325, 336, 347, 358, 369, 415, 426, 437, 448, 459, 516, 527, 538, 549, 617, 628, 639, 718, 729, 819, 1123, 1235, 1347, 1459, 1910, 2134, 2246, 2358, 2810, 2911, 3145, 3257, 3369
Offset: 1

Views

Author

Bi Cheng Wu, Nov 19 2019

Keywords

Examples

			112 -> 1+1=2;
1235 -> 1+2=3 and 2+3=5;
224610 -> 2+2=4 and 2+4=6 and 4+6=10.
		

Crossrefs

Shares subsequences with A108203, A308104, A214527.
Cf. A019523.

Programs

  • Mathematica
    part[n_] := part[n] = Select[Flatten[ Permutations /@ Reverse /@ IntegerPartitions[n, {3,n}], 1], 0 <= #[[3]] - Max[#[[1]], #[[2]]] <= 1 && AllTrue[Rest@ Rest@ Differences@ #, 0 <= # <= 1 &] &]; spl[x_, L_] := Map[ FromDigits@ Take[x, #] &, Transpose[{Most@ #, Rest[#]-1}& [ FoldList[ Plus, 1, L]]]]; sumQ[w_] := AllTrue[Range[3, Length@w], w[[#]] == w[[#-1]] + w[[#-2]] &]; ok[n_] := Block[{m = IntegerLength@ n}, AnyTrue[ spl[ IntegerDigits[n], #] & /@ part[m], sumQ[#] && Total[ IntegerLength /@ #] == m &]]; Select[ Range[100, 6000], ok] (* Giovanni Resta, Dec 03 2019 *)
  • Python
    def isSegmentSum(digits,segment1=None,segment2=None):
        digits = str(digits)
        N = len(digits)
        if N == 0:
            return True
        else:
            if (segment1 is None) and (segment2 is None):
                for i in range(N):
                    try:
                        slice1 = digits[:i+1]
                        for j in range(N-(i+1)):
                            slice2 = digits[i+1:i+1+j+1]
                            slice3 = digits[i+1+j+1:]
                            if (isSegmentSum(slice3,slice1,slice2) and
                             len(slice3)>0 and not (slice1.startswith("0") or
                             slice2.startswith("0") or
                             (slice3.startswith("0")))):
                                return True
                    except:
                        return False
            else:
                sumOfDigits = str(int(segment1)+int(segment2))
                nS = len(sumOfDigits)
                try:
                    if digits[:nS] == sumOfDigits:
                        return isSegmentSum(digits[nS:],segment2,digits[:nS])
                    else:
                        return False
                except:
                    return False
        return False
    def findSegmentSum(lower,upper):
        for i in range(lower,upper+1):
            if isSegmentSum(i):
                print(str(i))
    findSegmentSum(1, 5200)
Showing 1-2 of 2 results.