Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9308273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:35:31+00:00 2026-06-19T00:35:31+00:00

sequence: 1,2,3,…10 formula: x = n+1 suppose sequence is an array and at a

  • 0

sequence: 1,2,3,…10
formula: x = n+1

suppose sequence is an array and at a given time sequence contain 1,3,5 on first three indexes remaining contain 0

now next number should be 2 and array will have 1,2,3,5 on first four indexes remaining contain 0

now next number should be 4 and array will have 1,2,3,4,5 on first five indexes remaining contain 0

now next number should be 6 and array will have 1,2,3,5,6 on first six indexes remaining contain 0

function findNextNumber(numArry) {
    var number = 1;
    var tempArray = new Array();
    for (i = 0; i < 10; i++) {
        tempArray[i] = "E";
    }
    $.each(numArry, function () {
        if (this != 0) {
            tempArray[this] = "F"
        }
    });
    $.each(tempArray, function (index) {
        if (this == "E") {
            number = index + 1;
            return false;
        }
    });
    return number;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:35:32+00:00Added an answer on June 19, 2026 at 12:35 am

        function nextHole(array,until) {
          this.array=array;
          this.lastIndex=0;
          this.lastItem=0;
          this.until=until;
          this.loopFinished=false;
          this.done=false;
          this.reset = function(){
              this.lastIndex=0;
              this.lastItem=0;
              this.done=false;
              this.loopFinished=false;
          }
    
          this.getNext = function(){
    
            if (this.done){
                return null;
            }
    
            if (!this.loopFinished){                
                for(loop=this.lastIndex;loop<this.array.length ;loop++){
                    if (this.array[loop]!=this.lastItem+1){
    
                        this.lastItem++;
                        this.lastIndex=loop;
                        if (this.lastItem>until)
                            break;
    
    
                        return this.lastItem;
                    }else{
                        this.lastItem=this.array[loop];
                    }
    
                }
    
            }
            this.loopFinished=true;
            if (this.lastItem < this.until){
                return (++this.lastItem);
            }
            this.done=true;
            return null;
          }
    
        }
    
    
        var h = new nextHole([1,2,5,6,7,15],10);
        while(true){
            var n = h.getNext();
            if (n == null){
                break;
            }else{
                console.log(" yield: "+n);
            }
        }
    
    
        h.reset();
        while(true){
            var n = h.getNext();
            if (n == null){
                break;
            }else{
                console.log(" yield: "+n);
            }
        }
    
    
    
    </script>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Somewhat similar to fibonacci sequence Running time of an algorithm is given by T
Given sequence : [1,A,B,C,2,F,K,L,5,6,P,I,E] The numbers represent items that I identify as headers, whereas
Given the following sequence diagram, how to express the equivalent in a UML communication
Suppose I have a sequence and a list of lists: [A B C D
I'm experimenting with SEQUENCE objects in SQL Server, and getting the next value with
I have a sequence of images needed to display in a short time (PNG
I usually create a sequence from a single value using array syntax, like this:
Background: I have a sequence of contiguous, time-stamped data. The data-sequence has holes in
Given a sequence of trillion real numbers on a disk... How would you compute
Given a sequence of objects (I'll use strings in this example for simplicity) I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.